Base for objects that match invocation counts. More...
Public Types | |
typedef AutoPointer < InvokedRecorder > | AP |
internal shorthand | |
Public Member Functions | |
InvokedRecorder () | |
Creates the object. | |
virtual | ~InvokedRecorder () |
Destroys the object. | |
int | getInvocationCount () const |
Gets the current invocation count. | |
bool | hasBeenInvoked () const |
Tests if the method has been invoked at least once. | |
virtual bool | matches () |
Checks if an invocation matches the expectaton. | |
virtual void | incInvoked () |
Increments the invocation count. | |
virtual bool | hasDescription () |
Does the object provide meaningful description via describeTo() ?. | |
virtual String | describeTo (String &buffer) const |
Appends the description of this object to the buffer. | |
virtual void | verify () |
Verify that the expected value is within the allowed bounds. | |
void | verifyHasBeenInvoked () const |
Verifys that the object has been invoked at least once. | |
void | verifyHasBeenInvokedExactly (int expectedCount) const |
Verifys that the object has been invoked the given number. |
Base for objects that match invocation counts.
Definition at line 52 of file InvokedRecorder.h.
Appends the description of this object to the buffer.
buffer | The buffer that the description is appended to. |
Implements mockpp::SelfDescribing.
Reimplemented in mockpp::InvokeAtLeastMatcher, mockpp::InvokeAtLeastOnceMatcher, mockpp::InvokeAtMostMatcher, mockpp::InvokeCountMatcher, mockpp::InvokeOnceMatcher, and mockpp::UnlimitedMatcher.
Definition at line 84 of file InvokedRecorder.cpp.
int mockpp::InvokedRecorder::getInvocationCount | ( | ) | const |
Gets the current invocation count.
Definition at line 54 of file InvokedRecorder.cpp.
bool mockpp::InvokedRecorder::hasBeenInvoked | ( | ) | const |
Tests if the method has been invoked at least once.
Definition at line 60 of file InvokedRecorder.cpp.
bool mockpp::InvokedRecorder::hasDescription | ( | ) | [virtual] |
Does the object provide meaningful description via describeTo() ?.
Implements mockpp::TypelessMatcher.
Reimplemented in mockpp::InvokeAtLeastMatcher, mockpp::InvokeAtLeastOnceMatcher, mockpp::InvokeAtMostMatcher, mockpp::InvokeCountMatcher, mockpp::InvokeOnceMatcher, and mockpp::UnlimitedMatcher.
Definition at line 78 of file InvokedRecorder.cpp.
bool mockpp::InvokedRecorder::matches | ( | ) | [virtual] |
Checks if an invocation matches the expectaton.
Implements mockpp::TypelessMatcher.
Reimplemented in mockpp::InvokeAtLeastMatcher, mockpp::InvokeAtLeastOnceMatcher, mockpp::InvokeAtMostMatcher, mockpp::InvokeCountMatcher, mockpp::InvokeOnceMatcher, and mockpp::UnlimitedMatcher.
Definition at line 66 of file InvokedRecorder.cpp.
void mockpp::InvokedRecorder::verify | ( | ) | [virtual] |
Verify that the expected value is within the allowed bounds.
If it fails, an AssertionFailedError is thrown
Implements mockpp::Verifiable.
Reimplemented in mockpp::InvokeAtLeastMatcher, mockpp::InvokeAtLeastOnceMatcher, mockpp::InvokeAtMostMatcher, mockpp::InvokeCountMatcher, mockpp::InvokeOnceMatcher, and mockpp::UnlimitedMatcher.
Definition at line 90 of file InvokedRecorder.cpp.
void mockpp::InvokedRecorder::verifyHasBeenInvoked | ( | ) | const |
Verifys that the object has been invoked at least once.
An AssertionFailedError is throw if it has never been invoked.
Definition at line 96 of file InvokedRecorder.cpp.
void mockpp::InvokedRecorder::verifyHasBeenInvokedExactly | ( | int | expectedCount | ) | const |
Verifys that the object has been invoked the given number.
An AssertionFailedError is throw if the count does not match.
Definition at line 102 of file InvokedRecorder.cpp.