Represents a base generic matcher for evaluating patterns or conditions against input values. More...
#include <Matchers.hpp>
Public Types | |
| using | MatcherValueType = ValueType |
| The type of value to match against. | |
Public Member Functions | |
| 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 |
| virtual bool | compare (const ValueType &actual) const =0 |
| When implemented, compares the provided actual value against a predefined condition. | |
| virtual::QString | description (const ValueType &actual) const =0 |
| When implemented, provides a textual description of the current match result. | |
| 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. | |
| Matcher & | operator= (const Matcher &other) |
| Move assignment that changes the object by transferring the state from another instance. | |
| Matcher & | operator= (Matcher &&other) noexcept |
| Move assignment that changes the object by transferring the state from another instance. | |
Represents a base generic matcher for evaluating patterns or conditions against input values.
| ValueType | The type of value to match against. |
| using qt_mocks::common_matchers::Matcher< ValueType >::MatcherValueType = ValueType |
The type of value to match against.
|
explicit |
Constructs the object with the given expected value.
| value | The expected value used to initialise the matcher. |
|
explicit |
Constructs the object with the given the expected value object.
| expected | The expected value used to initialise the matcher. |
| qt_mocks::common_matchers::Matcher< ValueType >::Matcher | ( | const Matcher< ValueType > & | other | ) |
Copy constructor that creates a new matcher by copying the state of another matcher.
| other | The matcher instance to copy. |
|
noexcept |
Move constructor that initialises the object by transferring the state from another instance.
| other | The instance to be moved from. The object is left in an unspecified state. |
|
virtualdefault |
|
nodiscardpure virtual |
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.
| actual | The value to compare against the predefined condition. |
Implemented in qt_mocks::common_matchers::AllOfMatcher< ValueType, MatcherTypes >, qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >, qt_mocks::common_matchers::BetweenBeginInclusiveMatcher< ValueType >, qt_mocks::common_matchers::BetweenEndInclusiveMatcher< ValueType >, qt_mocks::common_matchers::BetweenExclusiveMatcher< ValueType >, qt_mocks::common_matchers::BetweenInclusiveMatcher< ValueType >, qt_mocks::common_matchers::BooleanMatcher, qt_mocks::common_matchers::ContainsStringMatcher< ValueType >, qt_mocks::common_matchers::EqualMatcher< ValueType >, qt_mocks::common_matchers::EqualMatcher< double >, qt_mocks::common_matchers::EqualMatcher< double >, qt_mocks::common_matchers::EqualMatcher< float >, qt_mocks::common_matchers::EqualMatcher< float >, qt_mocks::common_matchers::EqualMatcher< long double >, qt_mocks::common_matchers::EqualMatcher< long double >, qt_mocks::common_matchers::EqualMatcher<::QString >, qt_mocks::common_matchers::EqualMatcher<::QString >, qt_mocks::common_matchers::GreaterThanEqualMatcher< ValueType >, qt_mocks::common_matchers::GreaterThanMatcher< ValueType >, qt_mocks::common_matchers::IsEmptyMatcher< Container >, qt_mocks::common_matchers::LessThanEqualMatcher< ValueType >, qt_mocks::common_matchers::LessThanMatcher< ValueType >, qt_mocks::common_matchers::MemberFunctionMatcher< ClassType, MemberFunctionType, MatcherType >, qt_mocks::common_matchers::MemberVariableMatcher< ClassType, MemberVariableType, MatcherType >, qt_mocks::common_matchers::NegationMatcher< ValueType >, qt_mocks::common_matchers::NotEqualMatcher< ValueType >, and qt_mocks::common_matchers::SizeIsMatcher< Container >.
|
nodiscardpure virtual |
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.
| actual | The actual value being matched against. |
Implemented in qt_mocks::common_matchers::AllOfMatcher< ValueType, MatcherTypes >, qt_mocks::common_matchers::AnyOfMatcher< ValueType, MatcherTypes >, qt_mocks::common_matchers::BetweenBeginInclusiveMatcher< ValueType >, qt_mocks::common_matchers::BetweenEndInclusiveMatcher< ValueType >, qt_mocks::common_matchers::BetweenExclusiveMatcher< ValueType >, qt_mocks::common_matchers::BetweenInclusiveMatcher< ValueType >, qt_mocks::common_matchers::BooleanMatcher, qt_mocks::common_matchers::ContainsStringMatcher< ValueType >, qt_mocks::common_matchers::EqualMatcher< ValueType >, qt_mocks::common_matchers::EqualMatcher< double >, qt_mocks::common_matchers::EqualMatcher< double >, qt_mocks::common_matchers::EqualMatcher< float >, qt_mocks::common_matchers::EqualMatcher< float >, qt_mocks::common_matchers::EqualMatcher< long double >, qt_mocks::common_matchers::EqualMatcher< long double >, qt_mocks::common_matchers::EqualMatcher<::QString >, qt_mocks::common_matchers::EqualMatcher<::QString >, qt_mocks::common_matchers::GreaterThanEqualMatcher< ValueType >, qt_mocks::common_matchers::GreaterThanMatcher< ValueType >, qt_mocks::common_matchers::IsEmptyMatcher< Container >, qt_mocks::common_matchers::LessThanEqualMatcher< ValueType >, qt_mocks::common_matchers::LessThanMatcher< ValueType >, qt_mocks::common_matchers::MemberFunctionMatcher< ClassType, MemberFunctionType, MatcherType >, qt_mocks::common_matchers::MemberVariableMatcher< ClassType, MemberVariableType, MatcherType >, qt_mocks::common_matchers::NegationMatcher< ValueType >, qt_mocks::common_matchers::NotEqualMatcher< ValueType >, and qt_mocks::common_matchers::SizeIsMatcher< Container >.
|
nodiscardnoexcept |
Retrieves the expected value of the matcher.
|
nodiscardnoexcept |
Checks if an expected value is set for the matcher.
| Matcher & qt_mocks::common_matchers::Matcher< ValueType >::operator= | ( | const Matcher< ValueType > & | other | ) |
Move assignment that changes the object by transferring the state from another instance.
| other | The instance to be moved from. |
|
noexcept |
Move assignment that changes the object by transferring the state from another instance.
| other | The instance to be moved from. The object is left in an unspecified state. |