A class to verify the occurence of a substring. More...
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. |
A class to verify the occurence of a substring.
Definition at line 47 of file ExpectationSegment.h.
mockpp::ExpectationSegment< Str >::ExpectationSegment | ( | const String & | name, | |
VerifiableList * | parent = 0 | |||
) | [inline] |
Constructs the expectation.
name | human readable description about the expectation | |
parent | parent verifiable |
Definition at line 55 of file ExpectationSegment.h.
void mockpp::ExpectationSegment< Str >::setActual | ( | const Str & | aString | ) | [inline] |
Sets the actual target string which must contain the string segment.
aString | the actual target string |
Definition at line 85 of file ExpectationSegment.h.
void mockpp::ExpectationSegment< Str >::setExpected | ( | const Str & | segment | ) | [inline] |
Sets the expected sub string.
segment | substring which must occur |
Definition at line 99 of file ExpectationSegment.h.
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.
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.