mockpp::ExpectationValue< T > Class Template Reference
[Basic Mock Objects]

A class to verify the equality of expected and actual value. More...

Inheritance diagram for mockpp::ExpectationValue< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ExpectationValue (const String &name, VerifiableList *parent=0)
 Constructs the expectation.
virtual void clearActual ()
 Resets the internal state to reflect that there is no actual value set.
virtual void reset ()
 Resets the internal state completely.
void setActual (const T &value)
 Sets the actual value.
void setExpected (const T &value)
 Sets the expectation value.
virtual void setExpectNothing ()
 Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.
virtual void verify ()
 Verify that the expected and actual value are equal.

Protected Member Functions

virtual void clearExpectation ()
 Clears the expectation list.

Detailed Description

template<class T>
class mockpp::ExpectationValue< T >

A class to verify the equality of expected and actual value.

Attention: This class is not intended for float types! It just does not work! Use ExpectationBoundary instead.

Definition at line 50 of file ExpectationValue.h.


Constructor & Destructor Documentation

template<class T >
mockpp::ExpectationValue< T >::ExpectationValue ( const String name,
VerifiableList parent = 0 
) [inline]

Constructs the expectation.

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

Definition at line 59 of file ExpectationValue.h.


Member Function Documentation

template<class T >
void mockpp::ExpectationValue< T >::setActual ( const T &  value  )  [inline]

Sets the actual value.

Parameters:
value the actual value

Definition at line 88 of file ExpectationValue.h.

template<class T >
void mockpp::ExpectationValue< T >::setExpected ( const T &  value  )  [inline]

Sets the expectation value.

Parameters:
value target value

Definition at line 102 of file ExpectationValue.h.

template<class T >
virtual void mockpp::ExpectationValue< 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 116 of file ExpectationValue.h.

template<class T >
virtual void mockpp::ExpectationValue< T >::verify (  )  [inline, virtual]

Verify that the expected and actual value are equal.

If it fails, an AssertionFailedError is thrown

Implements mockpp::AbstractExpectation< T >.

Definition at line 126 of file ExpectationValue.h.


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

Generated on Tue Jan 5 09:48:59 2010 for mockpp by  doxygen 1.6.1