Base class for setting up mock objcts that are able to emulate a real world object. More...
Public Member Functions | |
MockObject (const String &name, VerifiableList *parent=0) | |
Constructs the mock object. | |
void | notImplemented () |
Throws a NotImplementedException with the actual objects typeid(). | |
virtual void | verify () |
Verifies the object and the mock objects it contains. | |
virtual void | reset () |
Sets all internal objects to the state after construction. |
Base class for setting up mock objcts that are able to emulate a real world object.
warning: One MockObject should never have another MockObject as child! Otherwise there might be collisons when verify()-ing the objects.
Definition at line 52 of file MockObject.h.
mockpp::MockObject::MockObject | ( | const String & | name, | |
VerifiableList * | parent = 0 | |||
) |
Constructs the mock object.
name | human readable description about the expectation | |
parent | parent verifiable |
Definition at line 44 of file MockObject.cpp.
void mockpp::MockObject::verify | ( | ) | [virtual] |
Verifies the object and the mock objects it contains.
If it fails, an AssertionFailedError is thrown
Implements mockpp::Verifiable.
Reimplemented in mockpp::MixedMockObject, mockpp::ChainableMockMethod0Common< RT >, mockpp::ChainableMockMethod1Common< RT, P1 >, mockpp::ChainableMockMethod2Common< RT, P1, P2 >, mockpp::ChainableMockMethod3Common< RT, P1, P2, P3 >, mockpp::ChainableMockMethod4Common< RT, P1, P2, P3, P4 >, mockpp::ChainableMockMethod5Common< RT, P1, P2, P3, P4, P5 >, mockpp::ChainableMockMethod6Common< RT, P1, P2, P3, P4, P5, P6 >, mockpp::ChainableMockObject, mockpp::VisitableMockMethodBase, mockpp::VisitableMockReturningMethodBase< R >, mockpp::VisitableMockObject, mockpp::VerifyingTestCase, mockpp::ChainableMockMethod0Common< void >, mockpp::ChainableMockMethod1Common< void, P1 >, mockpp::ChainableMockMethod2Common< void, P1, P2 >, mockpp::ChainableMockMethod3Common< void, P1, P2, P3 >, mockpp::ChainableMockMethod4Common< void, P1, P2, P3, P4 >, mockpp::ChainableMockMethod5Common< void, P1, P2, P3, P4, P5 >, and mockpp::ChainableMockMethod6Common< void, P1, P2, P3, P4, P5, P6 >.
Definition at line 71 of file MockObject.cpp.