Qt-Mocks 0.8.0-alpha.9
Mocking library using Qt Test inspired by Google Test
 
Loading...
Searching...
No Matches
qt_mocks::ValueGiver< ReturnType > Class Template Referencefinal

Encapsulates a value to be returned by a mocked function. More...

#include <Expectation.hpp>

Collaboration diagram for qt_mocks::ValueGiver< ReturnType >:

Public Member Functions

 ValueGiver (ReturnType value)
 Full initialisation constructor that species the value to return for a mocked function.
 
ReturnType giveValue () const noexcept
 

Detailed Description

template<typename ReturnType>
class qt_mocks::ValueGiver< ReturnType >

Encapsulates a value to be returned by a mocked function.

Template Parameters
ReturnTypeThe type of the value to be returned.

Constructor & Destructor Documentation

◆ ValueGiver()

template<typename ReturnType>
qt_mocks::ValueGiver< ReturnType >::ValueGiver ( ReturnType value)
explicit

Full initialisation constructor that species the value to return for a mocked function.

Parameters
valueThe initial value to be given.

Member Function Documentation

◆ giveValue()

template<typename ReturnType>
ReturnType qt_mocks::ValueGiver< ReturnType >::giveValue ( ) const
noexcept

Provides the stored value for a mocked function.

Returns
The stored value.