Test harness for AlexaInterfaceMessageSender
class.
More...
|
void | SetUp () override |
| Set up/tear down the test harness for running a test. More...
|
|
void | TearDown () override |
|
AVSMessageEndpoint | buildTestEndpoint (void) |
|
CapabilityTag | buildTestTag (void) |
|
CapabilityState | buildTestState (void) |
|
std::shared_ptr< AlexaInterfaceMessageSender > | createMessageSender (void) |
|
bool | removeMessageId (Document *document, std::string *messageId) |
|
bool | removeEventCorrelationToken (Document *document, std::string *eventCorrelationToken) |
|
bool | expectEventSent (const std::shared_ptr< AlexaInterfaceMessageSender > &sender, const std::string &jsonEventString, MessageRequestObserverInterface::Status sendStatus, std::function< void()> triggerOperation) |
|
bool | expectEventSentOnInvalidContext (const std::shared_ptr< AlexaInterfaceMessageSender > &sender, const std::string &jsonEventString, MessageRequestObserverInterface::Status sendStatus, std::function< void()> triggerOperation) |
|
bool | expectEventSentWithoutContext (const std::shared_ptr< AlexaInterfaceMessageSender > &sender, const std::string &jsonEventString, MessageRequestObserverInterface::Status sendStatus, std::function< void()> triggerOperation) |
|
bool | expectEventNotSentOnInvalidContext (const std::shared_ptr< AlexaInterfaceMessageSender > &sender, const std::string &jsonEventString, MessageRequestObserverInterface::Status sendStatus, std::function< void()> triggerOperation) |
|
bool | checkEventJson (std::string jsonEventString, std::string testEventString) |
|
virtual | ~Test () |
|
◆ buildTestEndpoint()
AVSMessageEndpoint alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::buildTestEndpoint |
( |
void |
| ) |
|
Build a test AVSMessageEndpoint object.
- Returns
- the test object
◆ buildTestState()
CapabilityState alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::buildTestState |
( |
void |
| ) |
|
Build a test CapabilityTag object.
- Returns
- the test object
◆ buildTestTag()
CapabilityTag alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::buildTestTag |
( |
void |
| ) |
|
Build a test CapabilityTag object.
- Returns
- the test object
◆ checkEventJson()
bool alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::checkEventJson |
( |
std::string |
jsonEventString, |
|
|
std::string |
testEventString |
|
) |
| |
Check to see that an event JSON matches the expected result after removing fields that are always different.
- Parameters
-
jsonEventString | the event JSON string to check |
testEventString | the event JSON string to test against |
- Returns
- true on success, false on failure
◆ createMessageSender()
std::shared_ptr< AlexaInterfaceMessageSender > alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::createMessageSender |
( |
void |
| ) |
|
◆ expectEventNotSentOnInvalidContext()
Setup mocks for an event that should not be sent if context is invalid.
- Parameters
-
jsonEventString | the expected event as a JSON string |
sendStatus | the send status result to be returned |
triggerOperation | the function to call to start the sending process |
- Returns
- true on success, false on failure
◆ expectEventSent()
Setup mocks for sending an event that expects the event to be sent on the happy path.
- Parameters
-
sender | the AlexaInterfaceMessageSender to use |
jsonEventString | the expected event as a JSON string |
sendStatus | the send status result to be returned |
triggerOperation | the function to call to start the sending process |
- Returns
- true on success, false on failure
◆ expectEventSentOnInvalidContext()
Setup mocks for sending an event, even if the context is invalid.
- Parameters
-
jsonEventString | the expected event as a JSON string |
sendStatus | the send status result to be returned |
triggerOperation | the function to call to start the sending process |
- Returns
- true on success, false on failure
◆ expectEventSentWithoutContext()
Setup mocks for sending an event that does not require context at all.
- Parameters
-
jsonEventString | the expected event as a JSON string |
sendStatus | the send status result to be returned |
triggerOperation | the function to call to start the sending process |
- Returns
- true on success, false on failure
◆ removeEventCorrelationToken()
bool alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::removeEventCorrelationToken |
( |
Document * |
document, |
|
|
std::string * |
eventCorrelationToken |
|
) |
| |
Helper function to remove the eventCorrelationToken.
- Parameters
-
document | The document from which to remove the eventCorrelationToken. |
eventCorrelationToken | The eventCorrelationToken that was removed (if successful). |
- Returns
- bool Indicates whether removing the eventCorrelationToken was successful.
◆ removeMessageId()
bool alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::removeMessageId |
( |
Document * |
document, |
|
|
std::string * |
messageId |
|
) |
| |
Helper function to remove the messageId.
- Parameters
-
document | The document from which to remove the messageId. |
messageId | The messageId that was removed (if successful). |
- Returns
- bool Indicates whether removing the messageId was successful.
◆ SetUp()
void alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::SetUp |
( |
| ) |
|
|
overridevirtual |
Set up/tear down the test harness for running a test.
Reimplemented from testing::Test.
◆ TearDown()
void alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::TearDown |
( |
| ) |
|
|
overridevirtual |
◆ m_context
AVSContext alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::m_context |
|
protected |
◆ m_messageSender
std::shared_ptr<MockMessageSender> alexaClientSDK::capabilityAgents::alexa::test::AlexaInterfaceMessageSenderTest::m_messageSender |
|
protected |
Message sender mock to track messages being sent.
◆ m_mockContextManager
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