Base class for all expectations. More...
Public Member Functions | |
AbstractExpectation (const String &name, VerifiableList *parent) | |
Constructs the expectation. | |
bool | hasExpectations () const |
Tests if any expectations have been set on this object. | |
void | setFailOnVerify () |
If an incorrect actual value is set, defer reporting this as a failure until verify() is called on this object. | |
void | clearFailOnVerify () |
If an incorrect actual value is set, report this immediately. | |
virtual void | clearActual ()=0 |
Resets the internal state to reflect that there is no actual value set. | |
virtual void | verify ()=0 |
Verifies the contained expectation. | |
Protected Member Functions | |
void | assertEquals (const String &message, const T &expectedValue, const T &actualValue) const |
Asserts that two values are equal. | |
bool | shouldCheckImmediately () const |
Tests if any actuals should be checked immediately when set. | |
void | setHasExpectations () |
Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error. | |
void | clearHasExpectations () |
Tells the object having no expectations yet. |
Base class for all expectations.
Definition at line 49 of file AbstractExpectation.h.
mockpp::AbstractExpectation< T >::AbstractExpectation | ( | const String & | name, | |
VerifiableList * | parent | |||
) | [inline] |
Constructs the expectation.
name | human readable description about the expectation | |
parent | parent verifiable |
Definition at line 57 of file AbstractExpectation.h.
void mockpp::AbstractExpectation< T >::assertEquals | ( | const String & | message, | |
const T & | expectedValue, | |||
const T & | actualValue | |||
) | const [inline, protected] |
Asserts that two values are equal.
message | a human readable description about the cause | |
expectedValue | the expected value | |
actualValue | the actual value |
Definition at line 114 of file AbstractExpectation.h.
bool mockpp::AbstractExpectation< T >::hasExpectations | ( | ) | const [inline, virtual] |
Tests if any expectations have been set on this object.
Implements mockpp::Expectation.
Definition at line 69 of file AbstractExpectation.h.
void mockpp::AbstractExpectation< T >::setHasExpectations | ( | ) | [inline, protected] |
Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.
The Expectation will fail if any actual values are set.
Note that this is not the same as not setting any expectations, in which case verify() will do nothing.
Definition at line 154 of file AbstractExpectation.h.
bool mockpp::AbstractExpectation< T >::shouldCheckImmediately | ( | ) | const [inline, protected] |
Tests if any actuals should be checked immediately when set.
Otherwise they are checked when verify() is called.
Definition at line 141 of file AbstractExpectation.h.
virtual void mockpp::AbstractExpectation< T >::verify | ( | ) | [pure virtual] |
Verifies the contained expectation.
If this fails an AssertionFailedError is thrown.
Implements mockpp::Verifiable.
Implemented in mockpp::ExpectationBoundary< T >, mockpp::ExpectationConglomeration< T >, mockpp::ExpectationCounter, mockpp::ExpectationList< T >, mockpp::ExpectationSegment< Str >, mockpp::ExpectationSet< T >, mockpp::ExpectationValue< T >, mockpp::TrackingCounterMaster, mockpp::TrackingCounterClient, mockpp::ConstraintList< T >, mockpp::ExpectationList< std::string >, mockpp::ExpectationSet< Key >, mockpp::ConstraintList< P1 >, mockpp::ConstraintList< P2 >, mockpp::ConstraintList< P3 >, mockpp::ConstraintList< P4 >, mockpp::ConstraintList< P5 >, and mockpp::ConstraintList< P6 >.