mockpp::ExpectationSegment< Str > Class Template Reference
[Basic Mock Objects]

A class to verify the occurence of a substring. More...

Inheritance diagram for mockpp::ExpectationSegment< Str >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ExpectationSegment (const String &name, VerifiableList *parent=0)
 Constructs the expectation.
virtual void reset ()
 Resets the internal state completely.
void clearActual ()
 Resets the internal state to reflect that there is no actual value set.
void setActual (const Str &aString)
 Sets the actual target string which must contain the string segment.
void setExpected (const Str &segment)
 Sets the expected sub string.
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 substring occurs in the target string.

Protected Member Functions

virtual void clearExpectation ()
 Clears the expectation list.

Detailed Description

template<class Str>
class mockpp::ExpectationSegment< Str >

A class to verify the occurence of a substring.

Definition at line 47 of file ExpectationSegment.h.


Constructor & Destructor Documentation

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

Constructs the expectation.

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

Definition at line 55 of file ExpectationSegment.h.


Member Function Documentation

template<class Str >
void mockpp::ExpectationSegment< Str >::setActual ( const Str &  aString  )  [inline]

Sets the actual target string which must contain the string segment.

Parameters:
aString the actual target string

Definition at line 85 of file ExpectationSegment.h.

template<class Str >
void mockpp::ExpectationSegment< Str >::setExpected ( const Str &  segment  )  [inline]

Sets the expected sub string.

Parameters:
segment substring which must occur

Definition at line 99 of file ExpectationSegment.h.

template<class Str >
void mockpp::ExpectationSegment< Str >::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 113 of file ExpectationSegment.h.

template<class Str >
virtual void mockpp::ExpectationSegment< Str >::verify (  )  [inline, virtual]

Verify that the substring occurs in the target string.

If it fails, an AssertionFailedError is thrown

Implements mockpp::AbstractExpectation< Str >.

Definition at line 123 of file ExpectationSegment.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