AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType > Class Template Reference

#include <MockNotifier.h>

Inheritance diagram for alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >:
Collaboration graph
[legend]

Public Member Functions

 MOCK_METHOD1_T (addObserver, void(const std::shared_ptr< ObserverType > &observer))
 
 MOCK_METHOD1_T (removeObserver, void(const std::shared_ptr< ObserverType > &observer))
 
 MOCK_METHOD1_T (addWeakPtrObserver, void(const std::weak_ptr< ObserverType > &observer))
 
 MOCK_METHOD1_T (removeWeakPtrObserver, void(const std::weak_ptr< ObserverType > &observer))
 
 MOCK_METHOD1_T (notifyObservers, void(std::function< void(const std::shared_ptr< ObserverType > &)>))
 
 MOCK_METHOD1_T (notifyObserversInReverse, bool(std::function< void(const std::shared_ptr< ObserverType > &)>))
 
 MOCK_METHOD1_T (setAddObserverFunction, void(std::function< void(const std::shared_ptr< ObserverType > &)>))
 
- Public Member Functions inherited from alexaClientSDK::acsdkNotifierInterfaces::NotifierInterface< ObserverType >
virtual ~NotifierInterface ()=default
 
virtual void addObserver (const std::shared_ptr< ObserverType > &observer)=0
 
virtual void removeObserver (const std::shared_ptr< ObserverType > &observer)=0
 
virtual void addWeakPtrObserver (const std::weak_ptr< ObserverType > &observer)=0
 
virtual void removeWeakPtrObserver (const std::weak_ptr< ObserverType > &observer)=0
 
virtual void notifyObservers (std::function< void(const std::shared_ptr< ObserverType > &)> notify)=0
 
virtual bool notifyObserversInReverse (std::function< void(const std::shared_ptr< ObserverType > &)> notify)=0
 
virtual void setAddObserverFunction (std::function< void(const std::shared_ptr< ObserverType > &)> postAddFunc)=0
 

Detailed Description

template<typename ObserverType>
class alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >

Mock class that implements NotifierInterface.

To make Expect calls against the observer you will need to set a ON_CALL WillByDefault assertion that will pass the args to the observer.

ON_CALL(MockNotifier, notifyObservers(_)) .WillByDefault(Invoke( [this](std::function<void( const std::shared_ptr<ObserverType>&)> notifyFn) { notifyFn(observer); }));

Member Function Documentation

◆ MOCK_METHOD1_T() [1/7]

template<typename ObserverType >
alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >::MOCK_METHOD1_T ( addObserver  ,
void(const std::shared_ptr< ObserverType > &observer)   
)

◆ MOCK_METHOD1_T() [2/7]

template<typename ObserverType >
alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >::MOCK_METHOD1_T ( addWeakPtrObserver  ,
void(const std::weak_ptr< ObserverType > &observer)   
)

◆ MOCK_METHOD1_T() [3/7]

template<typename ObserverType >
alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >::MOCK_METHOD1_T ( notifyObservers  ,
void(std::function< void(const std::shared_ptr< ObserverType > &)>)   
)

◆ MOCK_METHOD1_T() [4/7]

template<typename ObserverType >
alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >::MOCK_METHOD1_T ( notifyObserversInReverse  ,
bool(std::function< void(const std::shared_ptr< ObserverType > &)>)   
)

◆ MOCK_METHOD1_T() [5/7]

template<typename ObserverType >
alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >::MOCK_METHOD1_T ( removeObserver  ,
void(const std::shared_ptr< ObserverType > &observer)   
)

◆ MOCK_METHOD1_T() [6/7]

template<typename ObserverType >
alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >::MOCK_METHOD1_T ( removeWeakPtrObserver  ,
void(const std::weak_ptr< ObserverType > &observer)   
)

◆ MOCK_METHOD1_T() [7/7]

template<typename ObserverType >
alexaClientSDK::acsdkNotifierInterfaces::test::MockNotifier< ObserverType >::MOCK_METHOD1_T ( setAddObserverFunction  ,
void(std::function< void(const std::shared_ptr< ObserverType > &)>)   
)

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

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