A class to verify conglomerations of expectations: each expected object must occur at least once. More...
Classes | |
class | Boundary |
Public Member Functions | |
ExpectationConglomeration (const String &name, VerifiableList *parent=0) | |
Constructs the expectation. | |
void | addActual (const T &actualItem) |
Adds another actual value to the list. | |
template<class I > | |
void | addActual (I items, I end) |
Adds a sequence of actual values to the set. | |
ExpectationConglomeration & | addExpected (const T &expectedItem) |
Adds another expectation value to the list. | |
ExpectationConglomeration & | addExpectedBoundary (const T &lower, const T &upper) |
Adds another expectation boundary to the list. | |
template<class I > | |
ExpectationConglomeration & | addExpected (I items, I end) |
Adds a sequence of expectation values to the set. | |
virtual void | reset () |
Resets the internal state to reflect that there is no actual value set. | |
virtual void | clearActual () |
Resets the internal state to reflect that there is no actual value set. | |
virtual void | verify () |
Verify that the expected values equal the expected ones. | |
virtual void | setExpectNothing () |
Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error. | |
bool | contains (const T &val) const |
Checks if the actual value is contained in the conglomeration. | |
Protected Member Functions | |
virtual void | clearExpectation () |
Clears the expectation list. | |
virtual void | checkImmediateValue (const T &actualItem) const |
Checks if the actual value matches the expectation. |
A class to verify conglomerations of expectations: each expected object must occur at least once.
Definition at line 52 of file ExpectationConglomeration.h.
mockpp::ExpectationConglomeration< T >::ExpectationConglomeration | ( | const String & | name, | |
VerifiableList * | parent = 0 | |||
) | [inline] |
Constructs the expectation.
name | human readable description about the expectation | |
parent | parent verifiable |
Definition at line 61 of file ExpectationConglomeration.h.
void mockpp::ExpectationConglomeration< T >::addActual | ( | I | items, | |
I | end | |||
) | [inline] |
Adds a sequence of actual values to the set.
items | start iterator | |
end | terminating iterator (note: one element "behind" as always with STL) |
Definition at line 87 of file ExpectationConglomeration.h.
void mockpp::ExpectationConglomeration< T >::addActual | ( | const T & | actualItem | ) | [inline] |
Adds another actual value to the list.
actualItem | new value |
Definition at line 72 of file ExpectationConglomeration.h.
ExpectationConglomeration& mockpp::ExpectationConglomeration< T >::addExpected | ( | I | items, | |
I | end | |||
) | [inline] |
Adds a sequence of expectation values to the set.
items | start iterator | |
end | terminating iterator (note: one element "behind" as always with STL) |
Definition at line 127 of file ExpectationConglomeration.h.
ExpectationConglomeration& mockpp::ExpectationConglomeration< T >::addExpected | ( | const T & | expectedItem | ) | [inline] |
Adds another expectation value to the list.
expectedItem | new value |
Definition at line 98 of file ExpectationConglomeration.h.
ExpectationConglomeration& mockpp::ExpectationConglomeration< T >::addExpectedBoundary | ( | const T & | lower, | |
const T & | upper | |||
) | [inline] |
Adds another expectation boundary to the list.
lower | new lower value | |
upper | new upper value |
Definition at line 112 of file ExpectationConglomeration.h.
virtual void mockpp::ExpectationConglomeration< T >::checkImmediateValue | ( | const T & | actualItem | ) | const [inline, protected, virtual] |
Checks if the actual value matches the expectation.
Note: in a set there is always only one element of a given value and the order of the elements is not relevant. If it fails, an AssertionFailedError is thrown
Implements mockpp::AbstractExpectationCollection< T >.
Definition at line 243 of file ExpectationConglomeration.h.
bool mockpp::ExpectationConglomeration< T >::contains | ( | const T & | val | ) | const [inline] |
Checks if the actual value is contained in the conglomeration.
val | the value to search |
Definition at line 208 of file ExpectationConglomeration.h.
virtual void mockpp::ExpectationConglomeration< T >::setExpectNothing | ( | ) | [inline, 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 195 of file ExpectationConglomeration.h.
virtual void mockpp::ExpectationConglomeration< T >::verify | ( | ) | [inline, virtual] |
Verify that the expected values equal the expected ones.
Note: in a set there is always only one element of a given value and the order of the elements is not relevant. If it fails, an AssertionFailedError is thrown
Implements mockpp::AbstractExpectation< T >.
Definition at line 162 of file ExpectationConglomeration.h.