Base of all mock methods returning some value. More...
Public Member Functions | |
VisitableMockReturningMethodBase (const String &name, VisitableMockObject *parent) | |
Constructs the mock object. | |
void | setDefaultReturnValue (const R &rv) |
Sets the default return value. | |
void | addReturnValue (const R &rv, unsigned count=1) |
Adds another return value. | |
virtual void | reset () |
Sets all internal objects to the state after construction. | |
virtual void | verify () |
Verify that the expected and actual values are equal. | |
Protected Member Functions | |
R | determineReturnValue () const |
Determines the current return value. | |
Protected Attributes | |
ReturnObjectList< R > | returnValues |
shared internal member | |
bool | haveDefaultReturnValue |
shared internal member | |
bool | defaultReturnValueUsed |
shared internal member | |
R | defaultReturnValue |
shared internal member |
Base of all mock methods returning some value.
Definition at line 195 of file VisitableMockMethod.h.
mockpp::VisitableMockReturningMethodBase< R >::VisitableMockReturningMethodBase | ( | const String & | name, | |
VisitableMockObject * | parent | |||
) | [inline] |
Constructs the mock object.
name | the method name to mock | |
parent | parent Visitable mock object |
Definition at line 203 of file VisitableMockMethod.h.
void mockpp::VisitableMockReturningMethodBase< R >::addReturnValue | ( | const R & | rv, | |
unsigned | count = 1 | |||
) | [inline] |
Adds another return value.
The values from this list are return one after the other unless there are no other throwables or response values available.
rv | the next return value | |
count | the number of times this value shall be returned |
Definition at line 228 of file VisitableMockMethod.h.
R mockpp::VisitableMockReturningMethodBase< R >::determineReturnValue | ( | ) | const [inline, protected] |
Determines the current return value.
The values from the default value or the list are returned one after the other.
Definition at line 268 of file VisitableMockMethod.h.
void mockpp::VisitableMockReturningMethodBase< R >::setDefaultReturnValue | ( | const R & | rv | ) | [inline] |
Sets the default return value.
This value is returned if there are no throwables available and if there are no other possible return values in a list.
rv | the default return value |
Definition at line 215 of file VisitableMockMethod.h.
virtual void mockpp::VisitableMockReturningMethodBase< R >::verify | ( | ) | [inline, virtual] |
Verify that the expected and actual values are equal.
If it fails, an AssertionFailedError is thrown
Reimplemented from mockpp::VisitableMockMethodBase.
Definition at line 251 of file VisitableMockMethod.h.