A base class to keep track of occurrences. More...
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. |
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.
mockpp::TrackingCounterBase::TrackingCounterBase | ( | const String & | name, | |
VerifiableList * | parent = 0 | |||
) |
Constructs the expectation.
name | human readable description about the expectation | |
parent | parent TrackingCounterClient |
Definition at line 46 of file TrackingCounter.cpp.
virtual unsigned mockpp::TrackingCounterBase::getActual | ( | ) | const [pure virtual] |
Gets the number of actual Value.
Implemented in mockpp::TrackingCounterMaster, and mockpp::TrackingCounterClient.
unsigned mockpp::TrackingCounterBase::getExpectedMaxValue | ( | ) | const [protected] |
Gets the expected maximal count.
Definition at line 61 of file TrackingCounter.cpp.
unsigned mockpp::TrackingCounterBase::getExpectedMinValue | ( | ) | const [protected] |
Gets the expected minimal count.
Definition at line 55 of file TrackingCounter.cpp.
void mockpp::TrackingCounterBase::setExpected | ( | unsigned | expectedMinValue, | |
unsigned | expectedMaxValue | |||
) |
Sets the range of expected value.
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.
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.