AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::avsCommon::utils::TestMimeJsonPart Class Reference

#include <MimeUtils.h>

Inheritance diagram for alexaClientSDK::avsCommon::utils::TestMimeJsonPart:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::utils::TestMimeJsonPart:
Collaboration graph
[legend]

Public Member Functions

 TestMimeJsonPart (const std::string &boundaryString, int dataSize, std::shared_ptr< TestableMessageObserver > messageObserver)
 
 TestMimeJsonPart (const std::string &mimeString, const std::string &message, std::shared_ptr< TestableMessageObserver > messageObserver)
 
std::string getMimeString () const override
 
virtual bool validateMimeParsing () override
 

Detailed Description

A utility class to test a JSON MIME part, which our SDK interprets as Directives.

Constructor & Destructor Documentation

◆ TestMimeJsonPart() [1/2]

alexaClientSDK::avsCommon::utils::TestMimeJsonPart::TestMimeJsonPart ( const std::string &  boundaryString,
int  dataSize,
std::shared_ptr< TestableMessageObserver messageObserver 
)

Constructor.

Parameters
boundaryStringThe boundary string for the MIME text.
dataSizeThe size of the directive string to be generated and tested.
messageObserverThe object which will expect to receive the directive string once parsed elsewhere.

◆ TestMimeJsonPart() [2/2]

alexaClientSDK::avsCommon::utils::TestMimeJsonPart::TestMimeJsonPart ( const std::string &  mimeString,
const std::string &  message,
std::shared_ptr< TestableMessageObserver messageObserver 
)

Constructor.

Parameters
mimeStringThe mime string for this part, including a leading boundary
messageThe size of the directive string to be generated and tested.
messageObserverThe object which will expect to receive the directive string once parsed elsewhere.

Member Function Documentation

◆ getMimeString()

std::string alexaClientSDK::avsCommon::utils::TestMimeJsonPart::getMimeString ( ) const
overridevirtual

Convert the data of this logical MIME part to an actual string which may be used to feed a real MIME parser.

Parameters
boundaryStringThe boundary string for the MIME text.
Returns
The generated MIME string.

Implements alexaClientSDK::avsCommon::utils::TestMimePart.

◆ validateMimeParsing()

bool alexaClientSDK::avsCommon::utils::TestMimeJsonPart::validateMimeParsing ( )
overridevirtual

Function to validate the MIME part was parsed elsewhere and received correctly. Subclass specializations will expect to handle this in different ways, using different internal objects.

Returns
Whether the MIME part was parsed and received correctly.

Implements alexaClientSDK::avsCommon::utils::TestMimePart.


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

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