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

Represents the means of comparing two Qt strings for equality. More...

#include <Matchers.hpp>

Inheritance diagram for qt_mocks::common_matchers::EqualMatcher<::QString >:
Collaboration diagram for qt_mocks::common_matchers::EqualMatcher<::QString >:

Public Member Functions

bool compare (const ::QString &actual) const override
 Performs an equaliy compairson against a supplied value.
 
bool compare (const ::QString &actual) const override
 Compares the actual value with the expected value for equality.
 
::QString description (const ::QString &actual) const override
 Provides a textual description of the current match result.
 
::QString description (const ::QString &actual) const override
 Provides a textual description of the current match result.
 
- 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 Member Functions inherited from qt_mocks::common_matchers::Matcher<::QString >
 Matcher (const ExpectedValue< ::QString > &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< ::QString > > expected)
 Constructs the object with the given the expected value object.
 
virtual ~Matcher ()=default
 
const ExpectedValue< ::QString > & 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< ValueType >
using MatcherValueType = ValueType
 The type of value to match against.
 
- Public Types inherited from qt_mocks::common_matchers::Matcher<::QString >
using MatcherValueType
 The type of value to match against.
 

Detailed Description

Represents the means of comparing two Qt strings for equality.

Member Function Documentation

◆ compare() [1/2]

bool qt_mocks::common_matchers::EqualMatcher< ::QString >::compare ( const ::QString & actual) const
nodiscardoverridevirtual

Performs an equaliy compairson against a supplied value.

Parameters
actualThe generated value to compare against the expected value.
Returns
Gives true when the actual value and the expected value are the same.

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

◆ compare() [2/2]

bool qt_mocks::common_matchers::EqualMatcher<::QString >::compare ( const ::QString & actual) const
nodiscardoverridevirtual

Compares the actual value with the expected value for equality.

Parameters
actualThe actual value to compare.
Returns
True if the actual value matches the expected value, false otherwise.

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

◆ description() [1/2]

::QString qt_mocks::common_matchers::EqualMatcher< ::QString >::description ( const ::QString & actual) const
nodiscardoverridevirtual

Provides a textual description of the current match result.

It generates a human-readable description of the comparison between the expected and actual values, including the expected and actual values themselves.

Parameters
actualThe actual value being matched against.
Returns
The detailed description of the match operation.

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

◆ description() [2/2]

::QString qt_mocks::common_matchers::EqualMatcher<::QString >::description ( const ::QString & actual) const
nodiscardoverridevirtual

Provides a textual description of the current match result.

It generates a human-readable description of the comparison between the expected and actual values, including the expected and actual values themselves.

Parameters
actualThe actual value being matched against.
Returns
The detailed description of the match operation.

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