Decorates another Matcher, retaining the behaviour but allowing tests to be slightly more expressive. More...
#include <is.h>
Public Member Functions | |
Is (const QSharedPointer< Matcher< T > > &m) | |
virtual bool | matches (const T &item) const |
Evaluates the matcher for argument item. More... | |
virtual void | describeTo (Description &description) const |
Generates a description of the object. More... | |
virtual void | describeMismatch (const T &item, Description &description) const |
Generate a description of why the matcher has not accepted the item. More... | |
Public Member Functions inherited from HamcrestQt::BaseMatcher< T > | |
virtual QString | toString () const |
Decorates another Matcher, retaining the behaviour but allowing tests to be slightly more expressive.
For example: assertThat(cheese, equalTo(smelly)) vs. assertThat(cheese, is(equalTo(smelly)))
|
inlinevirtual |
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. |
Reimplemented from HamcrestQt::BaseMatcher< T >.
|
inlinevirtual |
Generates a description of the object.
The description may be part of a description of a larger object of which this is just a component, so it should be worded appropriately.
description | The description to be built or appended to. |
Implements HamcrestQt::SelfDescribing.
|
inlinevirtual |
Evaluates the matcher for argument item.
item | the object against which the matcher is evaluated. |
true
if item matches, otherwise false
.Implements HamcrestQt::Matcher< T >.