1 #ifndef HAMCRESTQT_ISEQUAL_H
2 #define HAMCRESTQT_ISEQUAL_H
4 #include <QSharedPointer>
6 #include "basematcher.h"
7 #include "description.h"
8 #include "areequal_p.h"
10 namespace HamcrestQt {
20 explicit IsEqual(
const T &equalArg) : expectedValue(equalArg) {}
22 virtual bool matches(
const T &actualValue)
const
24 return AreEqual(actualValue, expectedValue);
37 QSharedPointer<Matcher<T> > equalTo(
const T &operand)
39 return QSharedPointer<Matcher<T> >(
new IsEqual<T>(operand));
43 inline QSharedPointer<Matcher<const char*> > equalTo(
const char operand[])
45 return QSharedPointer<Matcher<const char*> >(
new IsEqual<const char*>(operand));
50 #endif // HAMCRESTQT_ISEQUAL_H
A description of a Matcher.
Definition: description.h:17
virtual bool matches(const T &actualValue) const
Evaluates the matcher for argument item.
Definition: isequal.h:22
Description & appendValue(const T &value)
Appends an arbitrary value to the description.
Definition: description.h:90
virtual void describeTo(Description &description) const
Generates a description of the object.
Definition: isequal.h:27
BaseClass for all Matcher implementations.
Definition: basematcher.h:17
Is the value equal to another value, as tested by the operator==() method?
Definition: isequal.h:17