An Expectation is an object that we set up at the beginning of a unit test to expect certain things to happen to it. More...
Public Member Functions | |
Expectation (const String &name, VerifiableList *parent) | |
Constructs the expectation. | |
virtual bool | hasExpectations () const =0 |
Tests if any expectations have been set on this object. | |
virtual void | setExpectNothing ()=0 |
Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error. | |
virtual void | setFailOnVerify ()=0 |
If an incorrect actual value is set, defer reporting this as a failure until verify() is called on this object. |
An Expectation is an object that we set up at the beginning of a unit test to expect certain things to happen to it.
If it is possible to tell, the Expectation will fail as soon as an incorrect value has been set.
Call verify() at the end of a unit test to check for missing or incomplete values.
If no expectations have been set on the object, then no checking will be done and verify() will do nothing.
Definition at line 66 of file Expectation.h.
mockpp::Expectation::Expectation | ( | const String & | name, | |
VerifiableList * | parent | |||
) | [inline] |
Constructs the expectation.
name | human readable description about the expectation | |
parent | parent verifiable |
Definition at line 75 of file Expectation.h.
virtual bool mockpp::Expectation::hasExpectations | ( | ) | const [pure virtual] |
Tests if any expectations have been set on this object.
Implemented in mockpp::AbstractExpectation< T >, mockpp::AbstractExpectation< std::string >, mockpp::AbstractExpectation< P1 >, mockpp::AbstractExpectation< Key >, mockpp::AbstractExpectation< P2 >, mockpp::AbstractExpectation< P3 >, mockpp::AbstractExpectation< P4 >, mockpp::AbstractExpectation< P5 >, mockpp::AbstractExpectation< Str >, mockpp::AbstractExpectation< P6 >, and mockpp::AbstractExpectation< unsigned >.
virtual void mockpp::Expectation::setExpectNothing | ( | ) | [pure virtual] |
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.
Implemented in mockpp::ExpectationBoundary< T >, mockpp::ExpectationConglomeration< T >, mockpp::ExpectationCounter, mockpp::ExpectationList< T >, mockpp::ExpectationSegment< Str >, mockpp::ExpectationSet< T >, mockpp::ExpectationValue< T >, mockpp::TrackingCounterBase, 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 >.