mockpp::InvokedRecorder Class Reference

Base for objects that match invocation counts. More...

Inheritance diagram for mockpp::InvokedRecorder:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

Base for objects that match invocation counts.

Definition at line 52 of file InvokedRecorder.h.


Member Function Documentation

String mockpp::InvokedRecorder::describeTo ( String buffer  )  const [virtual]

Appends the description of this object to the buffer.

Parameters:
buffer The buffer that the description is appended to.
Returns:
The current content of the buffer data

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.

Returns:
the 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.

Returns:
true: object has been invoked

Definition at line 60 of file InvokedRecorder.cpp.

bool mockpp::InvokedRecorder::hasDescription (  )  [virtual]

Does the object provide meaningful description via describeTo() ?.

Returns:
true: description is available

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.

Returns:
true: the invocation matches

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines

Generated on Tue Jan 5 09:49:08 2010 for mockpp by  doxygen 1.6.1