Qt-Mocks 0.8.0-alpha.9
Mocking library using Qt Test inspired by Google Test
 
Loading...
Searching...
No Matches
qt_mocks::Expectations< MockedObjectType > Struct Template Reference

A manager for collecting all function expectations for a given mocked object. Each expectation will be expected to be invoked in the order in which the expectations are built. More...

#include <Expectation.hpp>

Collaboration diagram for qt_mocks::Expectations< MockedObjectType >:

Public Member Functions

 Expectations (MockedObjectType &mockedObject)
 

Public Attributes

std::unordered_map< std::string, internal::ExpectationQueue > functionExpectationsQueue_
 
MockedObjectType & mockedObject_
 

Detailed Description

template<typename MockedObjectType>
struct qt_mocks::Expectations< MockedObjectType >

A manager for collecting all function expectations for a given mocked object. Each expectation will be expected to be invoked in the order in which the expectations are built.

Template Parameters
MockedObjectTypeThe type of the object that is mocked.

Constructor & Destructor Documentation

◆ Expectations()

template<typename MockedObjectType>
qt_mocks::Expectations< MockedObjectType >::Expectations ( MockedObjectType & mockedObject)
explicit

Full initialisation constructor.

Parameters
mockedObjectA reference to the mocked object to which expectations will be applied.

Member Data Documentation

◆ functionExpectationsQueue_

template<typename MockedObjectType>
std::unordered_map<std::string, internal::ExpectationQueue> qt_mocks::Expectations< MockedObjectType >::functionExpectationsQueue_

Stores the expectations for functions in the mock framework. This holds the expectations for various mocked function calls. The key is the mocked function name ID as a string, and the value is a container of the sequence of expectations for that function. This allows the mocking system to keep track of what actions are expected when specific functions are invoked on a mock object.

◆ mockedObject_

template<typename MockedObjectType>
MockedObjectType& qt_mocks::Expectations< MockedObjectType >::mockedObject_

The mocked object being tested. This member holds the actual instance of the mocked object to which expectations are applied. It serves as the primary interface through which the mock framework interacts with the object under test.