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

Classes

class  MockRangeControllerInterface
 
class  RangeControllerCapabilityAgentTest
 

Typedefs

using EndpointIdentifier = endpoints::EndpointIdentifier
 

Functions

static std::chrono::milliseconds TIMEOUT (1000)
 Timeout when waiting for futures to be set. More...
 
static const EndpointIdentifier TEST_ENDPOINT_ID ("testEndpointId")
 The test EndpointId. More...
 
static const EndpointIdentifier TEST_INSTANCE ("testInstance")
 The test instance. 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 ("correlationToken")
 Correlation token key. More...
 
static const std::string CORRELATION_TOKEN_TEST ("CorrelationToken_Test")
 Correlation token for testing. More...
 
static const std::string EVENT_CORRELATION_TOKEN ("eventCorrelationToken")
 Event correlation token key. More...
 
static const std::string EVENT_CORRELATION_TOKEN_TEST ("EventCorrelationToken_Test")
 Event correlation for testing. More...
 
static const std::string TIME_OF_SAMPLE ("timeOfSample")
 Time of sample key. More...
 
static const std::string TIME_OF_SAMPLE_TEST ("2017-02-03T16:20:50.523Z")
 Time of sample used for testing. More...
 
static std::shared_ptr< AVSDirectivebuildAVSDirective (std::string directiveName, std::string payload)
 
 TEST_F (RangeControllerCapabilityAgentTest, test_givenInvalidParameters_create_shouldFail)
 Test that create() returns a nullptr if called with invalid arguments. More...
 
 TEST_F (RangeControllerCapabilityAgentTest, test_setRangeValueDirective_successCase)
 
 TEST_F (RangeControllerCapabilityAgentTest, test_setRangeValueDirective_errorCase)
 
 TEST_F (RangeControllerCapabilityAgentTest, test_adjustRangeValueDirective_successCase)
 
 TEST_F (RangeControllerCapabilityAgentTest, test_adjustRangeValueDirective_errorCase)
 
 TEST_F (RangeControllerCapabilityAgentTest, test_reportStateChange_successCase)
 
 TEST_F (RangeControllerCapabilityAgentTest, test_reportStateChange_errorCase)
 
 TEST_F (RangeControllerCapabilityAgentTest, test_unknownDirectiveWithProactivelyReportedAndRetrievableTrue)
 
 TEST_F (RangeControllerCapabilityAgentTest, test_unknownDirectiveWithProactivelyReportedAndRetrievableFalse)
 

Variables

static const std::string NAMESPACE {"Alexa.RangeController"}
 The namespace for capability agent. More...
 
static const std::string INTERFACE_VERSION {"3"}
 The supported version. More...
 
static const std::string NAME_SETRANGEVALUE {"SetRangeValue"}
 The name for SetRangeValue directive. More...
 
static const std::string NAME_ADJUSTRANGEVALUE {"AdjustRangeValue"}
 The name for AdjustRangeValue directive. More...
 
static const std::string RANGEVALUE_PROPERTY_NAME {"rangeValue"}
 The name for rangeValue property. More...
 
static const std::string UNKNOWN_DIRECTIVE {"Unknown"}
 An unknown directive signature. More...
 
static double RANGE_VALUE_MINUMUM = 0
 Minimum range value for test. More...
 
static double RANGE_VALUE_MAXIMUM = 100
 Maximum range value for test. More...
 
static double RANGE_VALUE_MEDIUM = 50
 Medium preset for test. More...
 
static double RANGE_PRECISION = 1
 Range precision for test. More...
 
static const std::string SET_RANGE_VALUE_PAYLOAD_TEST
 SetRangeValue payload for testing. More...
 
static const std::string ADJUST_RANGE_VALUE_PAYLOAD_TEST
 AdjustRangeValue payload for testing. More...
 

Typedef Documentation

◆ EndpointIdentifier

Function Documentation

◆ buildAVSDirective()

static std::shared_ptr<AVSDirective> alexaClientSDK::capabilityAgents::rangeController::test::buildAVSDirective ( std::string  directiveName,
std::string  payload 
)
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()

static const std::string alexaClientSDK::capabilityAgents::rangeController::test::CORRELATION_TOKEN ( "correlationToken"  )
static

Correlation token key.

◆ CORRELATION_TOKEN_TEST()

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

Correlation token for testing.

◆ DIALOG_REQUEST_ID()

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

Dialog request Id key.

◆ DIALOG_REQUEST_ID_TEST()

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

DialogRequestId for testing.

◆ EVENT()

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

Event key.

◆ EVENT_CORRELATION_TOKEN()

static const std::string alexaClientSDK::capabilityAgents::rangeController::test::EVENT_CORRELATION_TOKEN ( "eventCorrelationToken"  )
static

Event correlation token key.

◆ EVENT_CORRELATION_TOKEN_TEST()

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

Event correlation for testing.

◆ HEADER()

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

Header key.

◆ MESSAGE_ID()

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

MessageId key.

◆ MESSAGE_ID_TEST()

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

MessageId for testing.

◆ TEST_ENDPOINT_ID()

static const EndpointIdentifier alexaClientSDK::capabilityAgents::rangeController::test::TEST_ENDPOINT_ID ( "testEndpointId"  )
static

The test EndpointId.

◆ TEST_F() [1/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_givenInvalidParameters_create_shouldFail   
)

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

◆ TEST_F() [2/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_setRangeValueDirective_successCase   
)

Test successful handling of SetRangeValue directive.

◆ TEST_F() [3/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_setRangeValueDirective_errorCase   
)

Test error path of SetRangeValue directive.

◆ TEST_F() [4/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_adjustRangeValueDirective_successCase   
)

Test successful handling of AdjustRangeValue directive.

◆ TEST_F() [5/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_adjustRangeValueDirective_errorCase   
)

Test error path of AdjustRangeValue directive.

◆ TEST_F() [6/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_reportStateChange_successCase   
)

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

◆ TEST_F() [7/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_reportStateChange_errorCase   
)

Test triggering of reportStateChange and subsequent failure to get the getRangeState and call to the ContextManager to report the failure.

◆ TEST_F() [8/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_unknownDirectiveWithProactivelyReportedAndRetrievableTrue   
)

Tests unknown Directive with both proactively reported and retrievable set. Expect that the sendExceptionEncountered and setFailed will be called.

◆ TEST_F() [9/9]

alexaClientSDK::capabilityAgents::rangeController::test::TEST_F ( RangeControllerCapabilityAgentTest  ,
test_unknownDirectiveWithProactivelyReportedAndRetrievableFalse   
)

Tests unknown Directive with both proactively reported and retrievable as false. Expect that the sendExceptionEncountered and setFailed will be called.

◆ TEST_INSTANCE()

static const EndpointIdentifier alexaClientSDK::capabilityAgents::rangeController::test::TEST_INSTANCE ( "testInstance"  )
static

The test instance.

◆ TIME_OF_SAMPLE()

static const std::string alexaClientSDK::capabilityAgents::rangeController::test::TIME_OF_SAMPLE ( "timeOfSample"  )
static

Time of sample key.

◆ TIME_OF_SAMPLE_TEST()

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

Time of sample used for testing.

◆ TIMEOUT()

static std::chrono::milliseconds alexaClientSDK::capabilityAgents::rangeController::test::TIMEOUT ( 1000  )
static

Timeout when waiting for futures to be set.

Variable Documentation

◆ ADJUST_RANGE_VALUE_PAYLOAD_TEST

const std::string alexaClientSDK::capabilityAgents::rangeController::test::ADJUST_RANGE_VALUE_PAYLOAD_TEST
static
Initial value:
= R"({
"rangeValueDelta":)" + std::to_string(RANGE_PRECISION) + R"(,
"rangeValueDeltaDefault":false
})"
static double RANGE_PRECISION
Range precision for test.
Definition: RangeControllerCapabilityAgentTest.cpp:128

AdjustRangeValue payload for testing.

◆ INTERFACE_VERSION

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

The supported version.

◆ NAME_ADJUSTRANGEVALUE

const std::string alexaClientSDK::capabilityAgents::rangeController::test::NAME_ADJUSTRANGEVALUE {"AdjustRangeValue"}
static

The name for AdjustRangeValue directive.

◆ NAME_SETRANGEVALUE

const std::string alexaClientSDK::capabilityAgents::rangeController::test::NAME_SETRANGEVALUE {"SetRangeValue"}
static

The name for SetRangeValue directive.

◆ NAMESPACE

const std::string alexaClientSDK::capabilityAgents::rangeController::test::NAMESPACE {"Alexa.RangeController"}
static

The namespace for capability agent.

◆ RANGE_PRECISION

double alexaClientSDK::capabilityAgents::rangeController::test::RANGE_PRECISION = 1
static

Range precision for test.

◆ RANGE_VALUE_MAXIMUM

double alexaClientSDK::capabilityAgents::rangeController::test::RANGE_VALUE_MAXIMUM = 100
static

Maximum range value for test.

◆ RANGE_VALUE_MEDIUM

double alexaClientSDK::capabilityAgents::rangeController::test::RANGE_VALUE_MEDIUM = 50
static

Medium preset for test.

◆ RANGE_VALUE_MINUMUM

double alexaClientSDK::capabilityAgents::rangeController::test::RANGE_VALUE_MINUMUM = 0
static

Minimum range value for test.

◆ RANGEVALUE_PROPERTY_NAME

const std::string alexaClientSDK::capabilityAgents::rangeController::test::RANGEVALUE_PROPERTY_NAME {"rangeValue"}
static

The name for rangeValue property.

◆ SET_RANGE_VALUE_PAYLOAD_TEST

const std::string alexaClientSDK::capabilityAgents::rangeController::test::SET_RANGE_VALUE_PAYLOAD_TEST
static
Initial value:
= R"({
"rangeValue":)" + std::to_string(RANGE_VALUE_MEDIUM) + R"(
})"
static double RANGE_VALUE_MEDIUM
Medium preset for test.
Definition: RangeControllerCapabilityAgentTest.cpp:125

SetRangeValue payload for testing.

◆ UNKNOWN_DIRECTIVE

const std::string alexaClientSDK::capabilityAgents::rangeController::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