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

Classes

class  InputControllerCapabilityAgentTest
 Test harness for InputControllerCapabilityAgentTest class. More...
 
class  MockHandler
 A Mock for InputControllerHandlerInterface. More...
 

Functions

 TEST_F (InputControllerCapabilityAgentTest, test_createNoHandlerFail)
 
 TEST_F (InputControllerCapabilityAgentTest, test_createNoExceptionHandlerFail)
 
 TEST_F (InputControllerCapabilityAgentTest, test_createEmptyConfigFail)
 
 TEST_F (InputControllerCapabilityAgentTest, test_createWithDuplicateFriendlyNamesFail)
 
 TEST_F (InputControllerCapabilityAgentTest, test_selectInputDirectiveSuccess)
 
 TEST_F (InputControllerCapabilityAgentTest, test_processInvalidDirectiveFail)
 

Variables

static const std::string SELECT_INPUT_DIRECTIVE_JSON_STRING
 A simple SelectInput directive JSON string. More...
 
static const std::string SELECT_INPUT_DIRECTIVE_INVALID_INPUT_JSON_STRING
 
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...
 
static const InputControllerHandlerInterface::InputFriendlyNameType INPUT_CONTROLLER_GOOD_CONFIG
 The valid input configuration used for testing. More...
 
static const InputControllerHandlerInterface::InputFriendlyNameType INPUT_CONTROLLER_DUPLICATE_FRIENDLY_NAMES_CONFIG
 An invalid input configuration with duplicated friendly names across inputs. More...
 
static const InputControllerHandlerInterface::InputFriendlyNameType INPUT_CONTROLLER_EMPTY_CONFIG {}
 An invalid input configuration with no inputs. More...
 
static const std::chrono::milliseconds TIMEOUT {500}
 

Function Documentation

◆ TEST_F() [1/6]

alexaClientSDK::acsdkInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_createEmptyConfigFail   
)

Test to verify the InputControllerCapabilityAgent cannot be created if config param is empty.

◆ TEST_F() [2/6]

alexaClientSDK::acsdkInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_createNoExceptionHandlerFail   
)

Test to verify the InputControllerCapabilityAgent cannot be created if exceptionHandler param is null.

◆ TEST_F() [3/6]

alexaClientSDK::acsdkInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_createNoHandlerFail   
)

Test to verify the InputControllerCapabilityAgent cannot be created if handler param is null.

◆ TEST_F() [4/6]

alexaClientSDK::acsdkInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_createWithDuplicateFriendlyNamesFail   
)

Test to verify the InputControllerCapabilityAgent cannot be created if the configuration is not correct.

◆ TEST_F() [5/6]

alexaClientSDK::acsdkInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_processInvalidDirectiveFail   
)

Test to verify if interface will send exceptions when the directive received is invalid

◆ TEST_F() [6/6]

alexaClientSDK::acsdkInputController::test::TEST_F ( InputControllerCapabilityAgentTest  ,
test_selectInputDirectiveSuccess   
)

Test to verify if a valid SelectInput directive will set the input successfully.

Variable Documentation

◆ INPUT_CONTROLLER_DUPLICATE_FRIENDLY_NAMES_CONFIG

const InputControllerHandlerInterface::InputFriendlyNameType alexaClientSDK::acsdkInputController::test::INPUT_CONTROLLER_DUPLICATE_FRIENDLY_NAMES_CONFIG
static
Initial value:
{
{"HDMI1", {"TV", "Television"}},
{"HDMI2", {"TV"}}}

An invalid input configuration with duplicated friendly names across inputs.

◆ INPUT_CONTROLLER_EMPTY_CONFIG

const InputControllerHandlerInterface::InputFriendlyNameType alexaClientSDK::acsdkInputController::test::INPUT_CONTROLLER_EMPTY_CONFIG {}
static

An invalid input configuration with no inputs.

◆ INPUT_CONTROLLER_GOOD_CONFIG

const InputControllerHandlerInterface::InputFriendlyNameType alexaClientSDK::acsdkInputController::test::INPUT_CONTROLLER_GOOD_CONFIG
static
Initial value:
{
{"HDMI1", {"TV", "Television"}},
{"HDMI2", {"Game Console"}}}

The valid input configuration used for testing.

◆ SELECT_INPUT_DIRECTIVE_INVALID_INPUT_JSON_STRING

const std::string alexaClientSDK::acsdkInputController::test::SELECT_INPUT_DIRECTIVE_INVALID_INPUT_JSON_STRING
static
Initial value:
= R"delim(
{
"directive": {
"header": {
"namespace": "Alexa.InputController",
"name": "SelectInput",
"messageId": "12345",
"dialogRequestId": "2"
},
"payload": {
"input": "RCA"
}
}
}
)delim"

A SelectInput directive with invalid input (i.e. not part of the configuration as specified in INPUT_CONTROLLER_CONFIG_JSON)

◆ SELECT_INPUT_DIRECTIVE_JSON_STRING

const std::string alexaClientSDK::acsdkInputController::test::SELECT_INPUT_DIRECTIVE_JSON_STRING
static
Initial value:
= R"delim(
{
"directive": {
"header": {
"namespace": "Alexa.InputController",
"name": "SelectInput",
"messageId": "12345",
"dialogRequestId": "2"
},
"payload": {
"input": "HDMI1"
}
}
}
)delim"

A simple SelectInput directive JSON string.

◆ SELECT_INPUT_EMPTY_INPUT_DIRECTIVE_JSON_STRING

const std::string alexaClientSDK::acsdkInputController::test::SELECT_INPUT_EMPTY_INPUT_DIRECTIVE_JSON_STRING
static
Initial value:
= R"delim(
{
"directive": {
"header": {
"namespace": "Alexa.InputController",
"name": "SelectInput",
"messageId": "12345",
"dialogRequestId": "2"
},
"payload": {
"input": ""
}
}
}
)delim"

A SelectInput directive with an empty input.

◆ SELECT_INPUT_MISSING_TAG_DIRECTIVE_JSON_STRING

const std::string alexaClientSDK::acsdkInputController::test::SELECT_INPUT_MISSING_TAG_DIRECTIVE_JSON_STRING
static
Initial value:
= R"delim(
{
"directive": {
"header": {
"namespace": "Alexa.InputController",
"name": "SelectInput",
"messageId": "12345",
"dialogRequestId": "2"
},
"payload": {
}
}
}
)delim"

A SelectInput directive without input field.

◆ TIMEOUT

const std::chrono::milliseconds alexaClientSDK::acsdkInputController::test::TIMEOUT {500}
static

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