mockpp::TrackingCounterBase Class Reference
[Basic Mock ObjectsPoor Man's Mock Objects]

A base class to keep track of occurrences. More...

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

List of all members.

Public Member Functions

 TrackingCounterBase (const String &name, VerifiableList *parent=0)
 Constructs the expectation.
virtual void clearActual ()=0
 Resets the internal state to reflect that there is no actual value set.
virtual void reset ()
 Resets the internal state to reflect that there is no actual value set.
void setExpected (unsigned expectedValue)
 Sets the exact number of expected value.
void setExpected (unsigned expectedMinValue, unsigned expectedMaxValue)
 Sets the range of expected value.
void setExpectNothing ()
 Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.
virtual unsigned getActual () const =0
 Gets the number of actual Value.

Protected Member Functions

unsigned getExpectedMinValue () const
 Gets the expected minimal count.
unsigned getExpectedMaxValue () const
 Gets the expected maximal count.
virtual void clearExpectation ()
 Clears the expectation list.
virtual bool isExpectNothing () const
 Tests if the object expects nothing.

Detailed Description

A base class to keep track of occurrences.

There a groups with related counter objects which are all based on a shared counter value.

Definition at line 50 of file TrackingCounter.h.


Constructor & Destructor Documentation

mockpp::TrackingCounterBase::TrackingCounterBase ( const String name,
VerifiableList parent = 0 
)

Constructs the expectation.

Parameters:
name human readable description about the expectation
parent parent TrackingCounterClient

Definition at line 46 of file TrackingCounter.cpp.


Member Function Documentation

virtual unsigned mockpp::TrackingCounterBase::getActual (  )  const [pure virtual]

Gets the number of actual Value.

Returns:
counter value.

Implemented in mockpp::TrackingCounterMaster, and mockpp::TrackingCounterClient.

unsigned mockpp::TrackingCounterBase::getExpectedMaxValue (  )  const [protected]

Gets the expected maximal count.

Returns:
counter value.

Definition at line 61 of file TrackingCounter.cpp.

unsigned mockpp::TrackingCounterBase::getExpectedMinValue (  )  const [protected]

Gets the expected minimal count.

Returns:
counter value.

Definition at line 55 of file TrackingCounter.cpp.

void mockpp::TrackingCounterBase::setExpected ( unsigned  expectedMinValue,
unsigned  expectedMaxValue 
)

Sets the range of expected value.

Parameters:
expectedMinValue lower bound of expected value
expectedMaxValue upper bound of expected value

Definition at line 82 of file TrackingCounter.cpp.

void mockpp::TrackingCounterBase::setExpected ( unsigned  expectedValue  ) 

Sets the exact number of expected value.

Parameters:
expectedValue number of expected value

Definition at line 92 of file TrackingCounter.cpp.

void mockpp::TrackingCounterBase::setExpectNothing (  )  [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 104 of file TrackingCounter.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:00 2010 for mockpp by  doxygen 1.6.1