mockpp::VisitableMockReturningMethodBase< R > Class Template Reference

Base of all mock methods returning some value. More...

Inheritance diagram for mockpp::VisitableMockReturningMethodBase< R >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 VisitableMockReturningMethodBase (const String &name, VisitableMockObject *parent)
 Constructs the mock object.
void setDefaultReturnValue (const R &rv)
 Sets the default return value.
void addReturnValue (const R &rv, unsigned count=1)
 Adds another return value.
virtual void reset ()
 Sets all internal objects to the state after construction.
virtual void verify ()
 Verify that the expected and actual values are equal.

Protected Member Functions

determineReturnValue () const
 Determines the current return value.

Protected Attributes

ReturnObjectList< R > returnValues
 shared internal member
bool haveDefaultReturnValue
 shared internal member
bool defaultReturnValueUsed
 shared internal member
defaultReturnValue
 shared internal member

Detailed Description

template<typename R>
class mockpp::VisitableMockReturningMethodBase< R >

Base of all mock methods returning some value.

Definition at line 195 of file VisitableMockMethod.h.


Constructor & Destructor Documentation

template<typename R >
mockpp::VisitableMockReturningMethodBase< R >::VisitableMockReturningMethodBase ( const String name,
VisitableMockObject parent 
) [inline]

Constructs the mock object.

Parameters:
name the method name to mock
parent parent Visitable mock object

Definition at line 203 of file VisitableMockMethod.h.


Member Function Documentation

template<typename R >
void mockpp::VisitableMockReturningMethodBase< R >::addReturnValue ( const R &  rv,
unsigned  count = 1 
) [inline]

Adds another return value.

The values from this list are return one after the other unless there are no other throwables or response values available.

Parameters:
rv the next return value
count the number of times this value shall be returned

Definition at line 228 of file VisitableMockMethod.h.

template<typename R >
R mockpp::VisitableMockReturningMethodBase< R >::determineReturnValue (  )  const [inline, protected]

Determines the current return value.

The values from the default value or the list are returned one after the other.

Definition at line 268 of file VisitableMockMethod.h.

template<typename R >
void mockpp::VisitableMockReturningMethodBase< R >::setDefaultReturnValue ( const R &  rv  )  [inline]

Sets the default return value.

This value is returned if there are no throwables available and if there are no other possible return values in a list.

Parameters:
rv the default return value

Definition at line 215 of file VisitableMockMethod.h.

template<typename R >
virtual void mockpp::VisitableMockReturningMethodBase< R >::verify (  )  [inline, virtual]

Verify that the expected and actual values are equal.

If it fails, an AssertionFailedError is thrown

Reimplemented from mockpp::VisitableMockMethodBase.

Definition at line 251 of file VisitableMockMethod.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:49:15 2010 for mockpp by  doxygen 1.6.1