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

#include <Matchers.hpp>

Inheritance diagram for qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >:
Collaboration diagram for qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >:

Public Member Functions

 AnyOfMatcher (AnyOfMatcher &&) noexcept
 
 AnyOfMatcher (const AnyOfMatcher &)=delete
 
 AnyOfMatcher (MatcherTypes &&... matchers)
 
 ~AnyOfMatcher () override=default
 
bool compare (const ValueType &actual) const override
 When implemented, compares the provided actual value against a predefined condition.
 
::QString description (const ValueType &actual) const override
 When implemented, provides a textual description of the current match result.
 
AnyOfMatcheroperator= (AnyOfMatcher &&) noexcept
 
AnyOfMatcheroperator= (const AnyOfMatcher &)=delete
 
- Public Member Functions inherited from qt_mocks::common_matchers::Matcher< ValueType >
 Matcher (const ExpectedValue< ValueType > &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< ValueType > > expected)
 Constructs the object with the given the expected value object.
 
virtual ~Matcher ()=default
 
const ExpectedValue< ValueType > & 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.
 

Public Attributes

std::tuple< MatcherTypes... > matchers_
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ AnyOfMatcher() [1/3]

template<typename ValueType, typename ... MatcherTypes>
qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::AnyOfMatcher ( MatcherTypes &&... matchers)
explicit
Here is the caller graph for this function:

◆ AnyOfMatcher() [2/3]

template<typename ValueType, typename ... MatcherTypes>
qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::AnyOfMatcher ( const AnyOfMatcher< ValueType, MatcherTypes > & )
delete
Here is the call graph for this function:

◆ AnyOfMatcher() [3/3]

template<typename ValueType, typename ... MatcherTypes>
qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::AnyOfMatcher ( AnyOfMatcher< ValueType, MatcherTypes > && )
noexcept
Here is the call graph for this function:

◆ ~AnyOfMatcher()

template<typename ValueType, typename ... MatcherTypes>
qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::~AnyOfMatcher ( )
overridedefault
Here is the call graph for this function:

Member Function Documentation

◆ compare()

template<typename ValueType, typename ... MatcherTypes>
bool qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::compare ( const ValueType & 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< ValueType >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ description()

template<typename ValueType, typename ... MatcherTypes>
::QString qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::description ( const ValueType & 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< ValueType >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename ValueType, typename ... MatcherTypes>
AnyOfMatcher & qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::operator= ( AnyOfMatcher< ValueType, MatcherTypes > && )
noexcept
Here is the call graph for this function:

◆ operator=() [2/2]

template<typename ValueType, typename ... MatcherTypes>
AnyOfMatcher & qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::operator= ( const AnyOfMatcher< ValueType, MatcherTypes > & )
delete
Here is the call graph for this function:

Member Data Documentation

◆ matchers_

template<typename ValueType, typename ... MatcherTypes>
std::tuple<MatcherTypes...> qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >::matchers_