mockpp::Verifiable Class Reference

A Verifiable is an object that can confirm at the end of a unit test that the correct behaviour has occurred. More...

Inheritance diagram for mockpp::Verifiable:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Verifiable (const String &name, VerifiableList *parent)
 Constructs the expectation.
virtual ~Verifiable ()
 Destructs the expectation.
virtual void verify ()=0
 Throws an AssertionFailedException if any expectations have not been met.
virtual void reset ()=0
 Sets all internal data to the state after construction.
String getVerifiableName () const
 Gets the name of the current mock object.
void setParent (VerifiableList *parent)
 Sets a pointer to the parent of this object.
VerifiableListgetParent () const
 Gets a pointer to the parent of this object.
virtual unsigned numVerifiables () const
 Gets the number of verifiable sub-objects.

Protected Member Functions

virtual VerifiablegetVerifiable (unsigned idx)
 Gets a pointer to a verifiable sub-obect.

Friends

class MockObject

Detailed Description

A Verifiable is an object that can confirm at the end of a unit test that the correct behaviour has occurred.

See also:
Verifier to check all the Verifiables in an object.

Definition at line 48 of file Verifiable.h.


Constructor & Destructor Documentation

mockpp::Verifiable::Verifiable ( const String name,
VerifiableList parent 
)

Constructs the expectation.

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

Definition at line 43 of file Verifiable.cpp.


Member Function Documentation

VerifiableList * mockpp::Verifiable::getParent (  )  const

Gets a pointer to the parent of this object.

Returns:
pointer to parent

Definition at line 72 of file Verifiable.cpp.

Verifiable * mockpp::Verifiable::getVerifiable ( unsigned  idx  )  [protected, virtual]

Gets a pointer to a verifiable sub-obect.

Parameters:
idx index of object in the list
Returns:
pointer to object

Reimplemented in mockpp::VerifiableList.

Definition at line 84 of file Verifiable.cpp.

String mockpp::Verifiable::getVerifiableName (  )  const

Gets the name of the current mock object.

Names can be arbitrarily but should be chosen carefully to be able to find the according object.

Returns:
objects name

Definition at line 52 of file Verifiable.cpp.

unsigned mockpp::Verifiable::numVerifiables (  )  const [virtual]

Gets the number of verifiable sub-objects.

Returns:
number of objects

Reimplemented in mockpp::VerifiableList.

Definition at line 78 of file Verifiable.cpp.

void mockpp::Verifiable::setParent ( VerifiableList parent  ) 

Sets a pointer to the parent of this object.

Parameters:
parent pointer to parent

Definition at line 66 of file Verifiable.cpp.


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

Generated on Tue Jan 5 09:49:01 2010 for mockpp by  doxygen 1.6.1