mockpp::InvocationMockerBase< R, I > Class Template Reference

Base class for helper objects to mock invocations. More...

Inheritance diagram for mockpp::InvocationMockerBase< R, I >:
Inheritance graph
[legend]

List of all members.

Classes

class  DefaultDescriber
 Default describer. More...
class  Describer
 This encapsulates knowledge about how the InvocationMockerBuilder class adds matchers to an InvocationMocker. More...
class  DescriberBase
 Base for describer objects. More...

Public Types

typedef std::vector
< InvocationMatcher< I > * > 
List
 internal shorthand
typedef List::iterator Iterator
 internal shorthand
typedef List::const_iterator ConstIterator
 internal shorthand

Public Member Functions

virtual ~InvocationMockerBase ()
 Destroys the object.
virtual void reset ()
 Removes all the objects from the list.
virtual bool matches (const I &invocation)
 Checks if an invocation matches the expectaton.
virtual void verify ()
 Verify that the expected value is within the allowed bounds.
virtual void setName (const String &in_name)
 Sets the object's name.
virtual void addMatcher (const MatcherHolder< I > &holder)
 Adds another matcher.
virtual void setStub (const StubHolder< R, I > &in_stub)
 Sets the stub data for the invocation.
virtual bool hasDescription ()
 Does the object provide meaningful description via describeTo() ?.
virtual String describeTo (String &buffer) const
 Appends the description of this object to the buffer.

Protected Member Functions

 InvocationMockerBase (AutoPointer< DescriberBase > in_describer, const StubHolder< R, I > &defaultStub)
 Constructs the object.

Protected Attributes

List matchers
 internal shorthand
Stub< R, I >::AP stub
 internal shorthand

Detailed Description

template<typename R, typename I>
class mockpp::InvocationMockerBase< R, I >

Base class for helper objects to mock invocations.

Definition at line 63 of file InvocationMocker.h.


Constructor & Destructor Documentation

template<typename R, typename I>
mockpp::InvocationMockerBase< R, I >::InvocationMockerBase ( AutoPointer< DescriberBase in_describer,
const StubHolder< R, I > &  defaultStub 
) [inline, protected]

Constructs the object.

Parameters:
in_describer pointer to describer object
defaultStub pointer to default stub object

Definition at line 76 of file InvocationMocker.h.


Member Function Documentation

template<typename R, typename I>
virtual void mockpp::InvocationMockerBase< R, I >::addMatcher ( const MatcherHolder< I > &  holder  )  [inline, virtual]

Adds another matcher.

Parameters:
holder the matcher object
Returns:
the builder object

Implements mockpp::StubMatchersCollection< R, I >.

Definition at line 154 of file InvocationMocker.h.

template<typename R, typename I>
virtual String mockpp::InvocationMockerBase< R, I >::describeTo ( String buffer  )  const [inline, virtual]

Appends the description of this object to the buffer.

Parameters:
buffer The buffer that the description is appended to.
Returns:
The current content of the buffer data

Implements mockpp::SelfDescribing.

Definition at line 180 of file InvocationMocker.h.

template<typename R, typename I>
virtual bool mockpp::InvocationMockerBase< R, I >::hasDescription (  )  [inline, virtual]

Does the object provide meaningful description via describeTo() ?.

Returns:
true: description is available

Implements mockpp::Invokable< R, I >.

Definition at line 171 of file InvocationMocker.h.

template<typename R, typename I>
virtual bool mockpp::InvocationMockerBase< R, I >::matches ( const I &  invocation  )  [inline, virtual]

Checks if an invocation matches the expectaton.

Parameters:
invocation the invocation data
Returns:
true: the invocation matches

Implements mockpp::Invokable< R, I >.

Definition at line 113 of file InvocationMocker.h.

template<typename R, typename I>
virtual void mockpp::InvocationMockerBase< R, I >::setStub ( const StubHolder< R, I > &  in_stub  )  [inline, virtual]

Sets the stub data for the invocation.

Parameters:
in_stub the stub object

Implements mockpp::StubMatchersCollection< R, I >.

Definition at line 163 of file InvocationMocker.h.

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

Verify that the expected value is within the allowed bounds.

If it fails, an AssertionFailedError is thrown

Implements mockpp::Verifiable.

Definition at line 126 of file InvocationMocker.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:13 2010 for mockpp by  doxygen 1.6.1