#include <MockSettingProtocol.h>
Mock class that implements SettingProtocolInterface
.
- Note
- This is not thread safe and it runs the protocol synchronously to keep tests simple.
◆ MockSettingProtocol()
alexaClientSDK::settings::test::MockSettingProtocol::MockSettingProtocol |
( |
const std::string & |
initialValue, |
|
|
bool |
applyChange, |
|
|
bool |
revertChange |
|
) |
| |
◆ avsChange()
Implements the protocol for changing a setting value triggered by an AVS directive.
- Parameters
-
applyChange | Function that can be used to apply the new value. |
revertChange | Function that can be used to revert the change. This function should only be called if the apply change succeeded but some other part of the protocol has failed. |
notifyObservers | Function used to notify the observers of the protocol result. |
- Returns
true
if the directive was enqueued correctly; false
otherwise.
Implements alexaClientSDK::settings::SettingProtocolInterface.
◆ clearData()
bool alexaClientSDK::settings::test::MockSettingProtocol::clearData |
( |
| ) |
|
|
overridevirtual |
◆ isDataCleared()
bool alexaClientSDK::settings::test::MockSettingProtocol::isDataCleared |
( |
| ) |
|
◆ localChange()
Implements the protocol for changing a setting value through local UI.
- Parameters
-
applyChange | Function that can be used to apply the new value. |
revertChange | Function that can be used to revert the change. This function should only be called if the apply change succeeded but some other part of the protocol has failed. |
notifyObservers | Function used to notify the observers of the protocol result. |
- Returns
- Returns what was the set result.
Implements alexaClientSDK::settings::SettingProtocolInterface.
◆ restoreValue()
Implements the protocol for restoring a value from the storage.
- Parameters
-
applyChange | Function that can be used to apply the value restored from the storage. This function will be called with empty string if no value was found in the database. |
notifyObservers | Function used to notify the observers of the protocol result. |
- Returns
true
if the directive was enqueued correctly; false
otherwise.
Implements alexaClientSDK::settings::SettingProtocolInterface.
The documentation for this class was generated from the following file:
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0