A matcher over acceptable values. More...
#include <matcher.h>
Public Member Functions | |
virtual bool | matches (const T &item) const =0 |
Evaluates the matcher for argument item. More... | |
virtual void | describeMismatch (const T &item, Description &mismatchDescription) const =0 |
Generate a description of why the matcher has not accepted the item. More... | |
virtual QString | toString () const =0 |
Public Member Functions inherited from HamcrestQt::SelfDescribing | |
virtual void | describeTo (Description &description) const =0 |
Generates a description of the object. More... | |
A matcher over acceptable values.
A matcher is able to describe itself to give feedback when it fails.
|
pure virtual |
Generate a description of why the matcher has not accepted the item.
The description will be part of a larger description of why a matching failed, so it should be concise. This method assumes that matches(item)
is false, but will not check this.
item | The item that the Matcher has rejected. |
mismatchDescription | The description to be built or appended to. |
Implemented in HamcrestQt::Is< T >, HamcrestQt::SubstringMatcher, HamcrestQt::BaseMatcher< T >, HamcrestQt::BaseMatcher< QString >, and HamcrestQt::DiagnosingMatcher< T >.
|
pure virtual |
Evaluates the matcher for argument item.
item | the object against which the matcher is evaluated. |
true
if item matches, otherwise false
.Implemented in HamcrestQt::Is< T >, HamcrestQt::IsEqual< T >, HamcrestQt::AnyOf< T >, HamcrestQt::IsNot< T >, HamcrestQt::DiagnosingMatcher< T >, and HamcrestQt::SubstringMatcher.