AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::acsdkAlerts::test::MockAlertStorage Class Reference
Inheritance diagram for alexaClientSDK::acsdkAlerts::test::MockAlertStorage:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkAlerts::test::MockAlertStorage:
Collaboration graph
[legend]

Public Member Functions

 MOCK_METHOD0 (createDatabase, bool())
 
 MOCK_METHOD0 (open, bool())
 
 MOCK_METHOD0 (close, void())
 
 MOCK_METHOD1 (store, bool(std::shared_ptr< Alert >))
 
 MOCK_METHOD3 (storeOfflineAlert, bool(const std::string &, const std::string &, const std::string &))
 
 MOCK_METHOD2 (load, bool(std::vector< std::shared_ptr< Alert >> *, std::shared_ptr< settings::DeviceSettingsManager >))
 
 MOCK_METHOD2 (loadOfflineAlerts, bool(rapidjson::Value *, rapidjson::Document::AllocatorType &))
 
 MOCK_METHOD1 (modify, bool(std::shared_ptr< Alert >))
 
 MOCK_METHOD1 (erase, bool(std::shared_ptr< Alert >))
 
 MOCK_METHOD2 (eraseOffline, bool(const std::string &, int))
 
 MOCK_METHOD1 (bulkErase, bool(const std::list< std::shared_ptr< Alert >> &))
 
 MOCK_METHOD0 (clearDatabase, bool())
 
 MockAlertStorage ()
 
bool createDatabase ()
 
bool open ()
 
bool isOpen ()
 
void close ()
 
bool alertExists (const std::string &token)
 
bool store (std::shared_ptr< Alert > alert)
 
bool storeOfflineAlert (const std::string &token, const std::string &scheduledTime, const std::string &eventTime)
 
bool load (std::vector< std::shared_ptr< Alert >> *alertContainer, std::shared_ptr< settings::DeviceSettingsManager > settingsManager)
 
bool loadOfflineAlerts (rapidjson::Value *alertContainer, rapidjson::Document::AllocatorType &allocator)
 
bool erase (const std::vector< int > &alertDbIds)
 
bool eraseOffline (const std::string &token, int id)
 
void setCreateDatabaseRetVal (bool retVal)
 
void setOpenRetVal (bool retVal)
 
void setIsOpenRetVal (bool retVal)
 
void setAlertExistsRetVal (bool retVal)
 
void setStoreRetVal (bool retVal)
 
void setLoadRetVal (bool retVal)
 
void setEraseRetVal (bool retVal)
 
void setAlerts (std::vector< std::shared_ptr< TestAlert >> alertsToAdd)
 
 MOCK_METHOD1 (bulkErase, bool(const std::list< std::shared_ptr< Alert >> &))
 
 MOCK_METHOD1 (erase, bool(std::shared_ptr< Alert >))
 
 MOCK_METHOD1 (modify, bool(std::shared_ptr< Alert >))
 
 MOCK_METHOD0 (clearDatabase, bool())
 
- Public Member Functions inherited from alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface
virtual ~AlertStorageInterface ()=default
 
virtual bool modify (std::shared_ptr< Alert > alert)=0
 
virtual bool erase (std::shared_ptr< Alert > alert)=0
 
virtual bool bulkErase (const std::list< std::shared_ptr< Alert >> &alertList)=0
 
virtual bool clearDatabase ()=0
 

Detailed Description

Mock of AlertStorageInterface.

Constructor & Destructor Documentation

◆ MockAlertStorage()

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MockAlertStorage ( )
inline

Member Function Documentation

◆ alertExists()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::alertExists ( const std::string &  token)
inline

◆ close()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::close ( )
inlinevirtual

Close the currently open database, if one is open.

Implements alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface.

◆ createDatabase()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::createDatabase ( )
inlinevirtual

Creates a new database. If a database is already being handled by this object or there is another internal error, then this function returns false.

Returns
true If the database is created ok, or false if a database is already being handled by this object or there is a problem creating the database.

Implements alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface.

◆ erase()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::erase ( const std::vector< int > &  alertDbIds)
inline

◆ eraseOffline()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::eraseOffline ( const std::string &  token,
int  id 
)
inlinevirtual

Erases a single alert from the offline database.

Parameters
tokenThe alertToken of the alert to be erased.
idThe id of the alert to be erased
Returns
Whether the alert was successfully erased.

Implements alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface.

◆ isOpen()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::isOpen ( )
inline

◆ load()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::load ( std::vector< std::shared_ptr< Alert >> *  alertContainer,
std::shared_ptr< settings::DeviceSettingsManager settingsManager 
)
inlinevirtual

Loads all alerts in the database.

Parameters
[out]alertContainerThe container where alerts should be stored.
settingsManagerA settingsManager object that manages alarm volume ramp setting.
Returns
Whether the Alerts were successfully loaded.

Implements alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface.

◆ loadOfflineAlerts()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::loadOfflineAlerts ( rapidjson::Value *  alertContainer,
rapidjson::Document::AllocatorType &  allocator 
)
inlinevirtual

Loads all alerts in the offline database.

Parameters
[out]alertContainerThe container where alerts should be stored.
allocatorThe rapidjson allocator, required for the results of this function to be mergable with other rapidjson::Value objects.

Implements alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface.

◆ MOCK_METHOD0() [1/5]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD0 ( createDatabase  ,
bool()   
)

◆ MOCK_METHOD0() [2/5]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD0 ( open  ,
bool()   
)

◆ MOCK_METHOD0() [3/5]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD0 ( close  ,
void()   
)

◆ MOCK_METHOD0() [4/5]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD0 ( clearDatabase  ,
bool()   
)

◆ MOCK_METHOD0() [5/5]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD0 ( clearDatabase  ,
bool()   
)

◆ MOCK_METHOD1() [1/7]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD1 ( store  ,
bool(std::shared_ptr< Alert >)   
)

◆ MOCK_METHOD1() [2/7]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD1 ( modify  ,
bool(std::shared_ptr< Alert >)   
)

◆ MOCK_METHOD1() [3/7]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD1 ( erase  ,
bool(std::shared_ptr< Alert >)   
)

◆ MOCK_METHOD1() [4/7]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD1 ( bulkErase  ,
bool(const std::list< std::shared_ptr< Alert >> &)   
)

◆ MOCK_METHOD1() [5/7]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD1 ( bulkErase  ,
bool(const std::list< std::shared_ptr< Alert >> &)   
)

◆ MOCK_METHOD1() [6/7]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD1 ( erase  ,
bool(std::shared_ptr< Alert >)   
)

◆ MOCK_METHOD1() [7/7]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD1 ( modify  ,
bool(std::shared_ptr< Alert >)   
)

◆ MOCK_METHOD2() [1/3]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD2 ( load  ,
bool(std::vector< std::shared_ptr< Alert >> *, std::shared_ptr< settings::DeviceSettingsManager >)   
)

◆ MOCK_METHOD2() [2/3]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD2 ( loadOfflineAlerts  ,
bool(rapidjson::Value *, rapidjson::Document::AllocatorType &)   
)

◆ MOCK_METHOD2() [3/3]

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD2 ( eraseOffline  ,
bool(const std::string &, int)   
)

◆ MOCK_METHOD3()

alexaClientSDK::acsdkAlerts::test::MockAlertStorage::MOCK_METHOD3 ( storeOfflineAlert  ,
bool(const std::string &, const std::string &, const std::string &)   
)

◆ open()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::open ( )
inlinevirtual

Open an existing database. If this object is already managing an open database, or there is a problem opening the database, this function returns false.

Returns
true If the database is opened ok, false if this object is already managing an open database, or if there is another internal reason the database could not be opened.

Implements alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface.

◆ setAlertExistsRetVal()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::setAlertExistsRetVal ( bool  retVal)
inline

◆ setAlerts()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::setAlerts ( std::vector< std::shared_ptr< TestAlert >>  alertsToAdd)
inline

◆ setCreateDatabaseRetVal()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::setCreateDatabaseRetVal ( bool  retVal)
inline

◆ setEraseRetVal()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::setEraseRetVal ( bool  retVal)
inline

◆ setIsOpenRetVal()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::setIsOpenRetVal ( bool  retVal)
inline

◆ setLoadRetVal()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::setLoadRetVal ( bool  retVal)
inline

◆ setOpenRetVal()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::setOpenRetVal ( bool  retVal)
inline

◆ setStoreRetVal()

void alexaClientSDK::acsdkAlerts::test::MockAlertStorage::setStoreRetVal ( bool  retVal)
inline

◆ store()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::store ( std::shared_ptr< Alert alert)
inlinevirtual

Stores a single Alert in the database.

Parameters
TheAlert to store.
Returns
Whether the Alert was successfully stored.

Implements alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface.

◆ storeOfflineAlert()

bool alexaClientSDK::acsdkAlerts::test::MockAlertStorage::storeOfflineAlert ( const std::string &  token,
const std::string &  scheduledTime,
const std::string &  eventTime 
)
inlinevirtual

Stores a single Alert in the offline alerts database.

Parameters
tokenThe alertToken of the alert to be erased.
scheduledTimeThe scheduled time of the alert
eventTimethe time the alert stopped
Returns
Whether the Alert was successfully stored.

Implements alexaClientSDK::acsdkAlerts::storage::AlertStorageInterface.


The documentation for this class was generated from the following files:

AlexaClientSDK 1.26.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0