AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Functions | Variables
alexaClientSDK::alexaInputController::test Namespace Reference

Classes

class  InputControllerCapabilityAgentTest
 Test harness for InputControllerCapabilityAgentTest class. More...
 
class  MockHandler
 

Functions

static std::chrono::milliseconds TIMEOUT (1000)
 Timeout when waiting for futures to be set. More...
 
static const std::string TIME_OF_SAMPLE_TEST ("2017-02-03T16:20:50.523Z")
 Time of sample used for testing. More...
 
static const endpoints::EndpointIdentifier TEST_ENDPOINT_ID ("testEndpointId")
 The test EndpointId. More...
 
static const std::string EVENT ("event")
 Event key. More...
 
static const std::string HEADER ("header")
 Header key. More...
 
static const std::string MESSAGE_ID ("messageId")
 MessageId key. More...
 
static const std::string MESSAGE_ID_TEST ("MessageId_Test")
 MessageId for testing. More...
 
static const std::string DIALOG_REQUEST_ID ("dialogRequestId")
 Dialog request Id key. More...
 
static const std::string DIALOG_REQUEST_ID_TEST ("DialogRequestId_Test")
 DialogRequestId for testing. More...
 
static const std::string CORRELATION_TOKEN_TEST ("CorrelationToken_Test")
 Correlation token for testing. More...
 
static const std::string EVENT_CORRELATION_TOKEN_TEST ("EventCorrelationToken_Test")
 Event correlation for testing. More...
 
static std::shared_ptr< AVSDirectivebuildAVSDirective (std::string directiveName, std::string payload, std::string messageId=MESSAGE_ID_TEST)
 
 TEST_F (InputControllerCapabilityAgentTest, test_givenInvalidParameters_create_shouldFail)
 Test that create() returns a nullptr if called with invalid arguments. More...
 
 TEST_F (InputControllerCapabilityAgentTest, test_selectInputDirective_successCase)
 
 TEST_F (InputControllerCapabilityAgentTest, test_selectInputDirective_errorCase)
 
 TEST_F (InputControllerCapabilityAgentTest, test_reportStateChange_successCase)
 
 TEST_F (InputControllerCapabilityAgentTest, test_unknownInvalidDirective)
 

Variables

static const std::string NAMESPACE {"Alexa.InputController"}
 The namespace for capability agent. More...
 
static const std::string INTERFACE_VERSION {"3"}
 The supported version. More...
 
static const std::string NAME_SETMODE {"SelectInput"}
 The name for SelectInput directive. More...
 
static const std::string UNKNOWN_DIRECTIVE {"Unknown"}
 An unknown directive signature. More...
 
static const std::string INPUT_PROPERTY_NAME {"input"}
 The name for modeValue property. More...
 
static const Input CD_INPUT_TEST = Input::CD
 CD Input string for testing. More...
 
static const Input HDMI_1_INPUT_TEST = Input::HDMI_1
 HDMI 1 Input string for testing. More...
 
static const InputControllerInterface::SupportedInputs DEFAULT_ALLOWED_INPUT
 
static const std::string SELECT_INPUT_DIRECTIVE_JSON_STRING
 A simple SelectInput directive JSON string. More...
 
static const std::string SELECT_INPUT_UNSUPPORTED_DIRECTIVE_JSON_STRING
 A simple SelectInput directive JSON string. More...
 
static const std::string SELECT_INPUT_MISSING_TAG_DIRECTIVE_JSON_STRING
 A SelectInput directive without input field. More...
 
static const std::string SELECT_INPUT_EMPTY_INPUT_DIRECTIVE_JSON_STRING
 A SelectInput directive with an empty input. More...
 

Function Documentation

◆ buildAVSDirective()

static std::shared_ptr<AVSDirective> alexaClientSDK::alexaInputController::test::buildAVSDirective ( std::string  directiveName,
std::string  payload,
std::string  messageId = MESSAGE_ID_TEST 
)
static

Utility function to build the AVSDirective for test.

Parameters
directiveNameThe name of the test directive to build.
payloadThe unparsed payload of directive in JSON.
Returns
The created AVSDirective object or nullptr if build failed.

◆ CORRELATION_TOKEN_TEST()

static const std::string alexaClientSDK::alexaInputController::test::CORRELATION_TOKEN_TEST ( "CorrelationToken_Test"  )
static

Correlation token for testing.

◆ DIALOG_REQUEST_ID()

static const std::string alexaClientSDK::alexaInputController::test::DIALOG_REQUEST_ID ( "dialogRequestId"  )
static

Dialog request Id key.

◆ DIALOG_REQUEST_ID_TEST()

static const std::string alexaClientSDK::alexaInputController::test::DIALOG_REQUEST_ID_TEST ( "DialogRequestId_Test"  )
static

DialogRequestId for testing.

◆ EVENT()

static const std::string alexaClientSDK::alexaInputController::test::EVENT ( "event"  )
static

Event key.

◆ EVENT_CORRELATION_TOKEN_TEST()

static const std::string alexaClientSDK::alexaInputController::test::EVENT_CORRELATION_TOKEN_TEST ( "EventCorrelationToken_Test"  )
static

Event correlation for testing.

◆ HEADER()

static const std::string alexaClientSDK::alexaInputController::test::HEADER ( "header"  )
static

Header key.

◆ MESSAGE_ID()

static const std::string alexaClientSDK::alexaInputController::test::MESSAGE_ID ( "messageId"  )
static

MessageId key.

◆ MESSAGE_ID_TEST()

static const std::string alexaClientSDK::alexaInputController::test::MESSAGE_ID_TEST ( "MessageId_Test"  )
static

MessageId for testing.

◆ TEST_ENDPOINT_ID()

static const endpoints::EndpointIdentifier alexaClientSDK::alexaInputController::test::TEST_ENDPOINT_ID ( "testEndpointId"  )
static

The test EndpointId.

◆ TEST_F() [1/5]

alexaClientSDK::alexaInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_givenInvalidParameters_create_shouldFail   
)

Test that create() returns a nullptr if called with invalid arguments.

◆ TEST_F() [2/5]

alexaClientSDK::alexaInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_selectInputDirective_successCase   
)

Test successful handling of SelectInput directive.

◆ TEST_F() [3/5]

alexaClientSDK::alexaInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_selectInputDirective_errorCase   
)

Test error path of SelectInput directive.

◆ TEST_F() [4/5]

alexaClientSDK::alexaInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_reportStateChange_successCase   
)

Test triggering of reportStateChange and subsequent call to the ContextManager to build the context.

◆ TEST_F() [5/5]

alexaClientSDK::alexaInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_unknownInvalidDirective   
)

Tests unknown Directives. Expect that the sendExceptionEncountered and setFailed will be called.

◆ TIME_OF_SAMPLE_TEST()

static const std::string alexaClientSDK::alexaInputController::test::TIME_OF_SAMPLE_TEST ( "2017-02-03T16:20:50.523Z"  )
static

Time of sample used for testing.

◆ TIMEOUT()

static std::chrono::milliseconds alexaClientSDK::alexaInputController::test::TIMEOUT ( 1000  )
static

Timeout when waiting for futures to be set.

Variable Documentation

◆ CD_INPUT_TEST

const Input alexaClientSDK::alexaInputController::test::CD_INPUT_TEST = Input::CD
static

CD Input string for testing.

◆ DEFAULT_ALLOWED_INPUT

const InputControllerInterface::SupportedInputs alexaClientSDK::alexaInputController::test::DEFAULT_ALLOWED_INPUT
static
Initial value:
{{Input::HDMI_1, {"HDMI1"}},
{Input::CD, {"CD"}}}

◆ HDMI_1_INPUT_TEST

const Input alexaClientSDK::alexaInputController::test::HDMI_1_INPUT_TEST = Input::HDMI_1
static

HDMI 1 Input string for testing.

◆ INPUT_PROPERTY_NAME

const std::string alexaClientSDK::alexaInputController::test::INPUT_PROPERTY_NAME {"input"}
static

The name for modeValue property.

◆ INTERFACE_VERSION

const std::string alexaClientSDK::alexaInputController::test::INTERFACE_VERSION {"3"}
static

The supported version.

◆ NAME_SETMODE

const std::string alexaClientSDK::alexaInputController::test::NAME_SETMODE {"SelectInput"}
static

The name for SelectInput directive.

◆ NAMESPACE

const std::string alexaClientSDK::alexaInputController::test::NAMESPACE {"Alexa.InputController"}
static

The namespace for capability agent.

◆ SELECT_INPUT_DIRECTIVE_JSON_STRING

const std::string alexaClientSDK::alexaInputController::test::SELECT_INPUT_DIRECTIVE_JSON_STRING
static
Initial value:
= R"delim(
{
"input": "HDMI 1"
}
)delim"

A simple SelectInput directive JSON string.

◆ SELECT_INPUT_EMPTY_INPUT_DIRECTIVE_JSON_STRING

const std::string alexaClientSDK::alexaInputController::test::SELECT_INPUT_EMPTY_INPUT_DIRECTIVE_JSON_STRING
static
Initial value:
= R"delim(
{
"input": ""
}
)delim"

A SelectInput directive with an empty input.

◆ SELECT_INPUT_MISSING_TAG_DIRECTIVE_JSON_STRING

const std::string alexaClientSDK::alexaInputController::test::SELECT_INPUT_MISSING_TAG_DIRECTIVE_JSON_STRING
static
Initial value:
= R"delim(
{
}
)delim"

A SelectInput directive without input field.

◆ SELECT_INPUT_UNSUPPORTED_DIRECTIVE_JSON_STRING

const std::string alexaClientSDK::alexaInputController::test::SELECT_INPUT_UNSUPPORTED_DIRECTIVE_JSON_STRING
static
Initial value:
= R"delim(
{
"input": "HDMI 99"
}
)delim"

A simple SelectInput directive JSON string.

◆ UNKNOWN_DIRECTIVE

const std::string alexaClientSDK::alexaInputController::test::UNKNOWN_DIRECTIVE {"Unknown"}
static

An unknown directive signature.

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