A class to verify the equality of expected and actual value. More...
Public Member Functions | |
ExpectationValue (const String &name, VerifiableList *parent=0) | |
Constructs the expectation. | |
virtual void | clearActual () |
Resets the internal state to reflect that there is no actual value set. | |
virtual void | reset () |
Resets the internal state completely. | |
void | setActual (const T &value) |
Sets the actual value. | |
void | setExpected (const T &value) |
Sets the expectation value. | |
virtual void | setExpectNothing () |
Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error. | |
virtual void | verify () |
Verify that the expected and actual value are equal. | |
Protected Member Functions | |
virtual void | clearExpectation () |
Clears the expectation list. |
A class to verify the equality of expected and actual value.
Attention: This class is not intended for float types! It just does not work! Use ExpectationBoundary instead.
Definition at line 50 of file ExpectationValue.h.
mockpp::ExpectationValue< T >::ExpectationValue | ( | const String & | name, | |
VerifiableList * | parent = 0 | |||
) | [inline] |
Constructs the expectation.
name | human readable description about the expectation | |
parent | parent verifiable |
Definition at line 59 of file ExpectationValue.h.
void mockpp::ExpectationValue< T >::setActual | ( | const T & | value | ) | [inline] |
Sets the actual value.
value | the actual value |
Definition at line 88 of file ExpectationValue.h.
void mockpp::ExpectationValue< T >::setExpected | ( | const T & | value | ) | [inline] |
Sets the expectation value.
value | target value |
Definition at line 102 of file ExpectationValue.h.
virtual void mockpp::ExpectationValue< T >::setExpectNothing | ( | ) | [inline, 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.
Implements mockpp::Expectation.
Definition at line 116 of file ExpectationValue.h.
virtual void mockpp::ExpectationValue< T >::verify | ( | ) | [inline, virtual] |
Verify that the expected and actual value are equal.
If it fails, an AssertionFailedError is thrown
Implements mockpp::AbstractExpectation< T >.
Definition at line 126 of file ExpectationValue.h.