Qt-Mocks 0.8.0-alpha.9
Mocking library using Qt Test inspired by Google Test
 
Loading...
Searching...
No Matches
qt_mocks::common_matchers::IsEmptyMatcher< Container > Struct Template Referencefinal

#include <Matchers.hpp>

Inheritance diagram for qt_mocks::common_matchers::IsEmptyMatcher< Container >:
Collaboration diagram for qt_mocks::common_matchers::IsEmptyMatcher< Container >:

Public Member Functions

 IsEmptyMatcher ()
 
bool compare (const Container &actual) const override
 When implemented, compares the provided actual value against a predefined condition.
 
::QString description (const Container &actual) const override
 When implemented, provides a textual description of the current match result.
 
- Public Member Functions inherited from qt_mocks::common_matchers::Matcher< Container >
 Matcher (const ExpectedValue< Container > &value)
 Constructs the object with the given expected value.
 
 Matcher (const Matcher &other)
 Copy constructor that creates a new matcher by copying the state of another matcher.
 
 Matcher (Matcher &&other) noexcept
 Move constructor that initialises the object by transferring the state from another instance.
 
 Matcher (std::unique_ptr< ExpectedValue< Container > > expected)
 Constructs the object with the given the expected value object.
 
virtual ~Matcher ()=default
 
const ExpectedValue< Container > & expected () const noexcept
 Retrieves the expected value of the matcher.
 
bool hasExpected () const noexcept
 Checks if an expected value is set for the matcher.
 
Matcheroperator= (const Matcher &other)
 Move assignment that changes the object by transferring the state from another instance.
 
Matcheroperator= (Matcher &&other) noexcept
 Move assignment that changes the object by transferring the state from another instance.
 

Additional Inherited Members

- Public Types inherited from qt_mocks::common_matchers::Matcher< Container >
using MatcherValueType
 The type of value to match against.
 

Constructor & Destructor Documentation

◆ IsEmptyMatcher()

template<typename Container>
qt_mocks::common_matchers::IsEmptyMatcher< Container >::IsEmptyMatcher ( )

Member Function Documentation

◆ compare()

template<typename Container>
bool qt_mocks::common_matchers::IsEmptyMatcher< Container >::compare ( const Container & actual) const
nodiscardoverridevirtual

When implemented, compares the provided actual value against a predefined condition.

This method performs a comparison between the given value and the expected or predefined condition to determine if they match.

Parameters
actualThe value to compare against the predefined condition.
Returns
True if the comparison succeeds; otherwise, false.

Implements qt_mocks::common_matchers::Matcher< Container >.

◆ description()

template<typename Container>
::QString qt_mocks::common_matchers::IsEmptyMatcher< Container >::description ( const Container & actual) const
nodiscardoverridevirtual

When implemented, provides a textual description of the current match result.

It generates a human-readable description of the comparison between the expected and actual values, enabling easier debugging and clear understanding of matcher evaluations.

Parameters
actualThe actual value being matched against.
Returns
The detailed description of the match operation's expectation for successful pass.

Implements qt_mocks::common_matchers::Matcher< Container >.