TestCase Class Referenceabstract

Represents a test case, which is usually created through a macro that defines a subclass. More...

`#include <TestCase.h>`

Inheritance diagram for TestCase:

## Public Member Functions

| TestCase (const string &name)
| Construct a test case with the given name.
virtual bool | accept (TestVisitor &visitor)
| Makes the visitor visit this object as per the Visitor Pattern.
virtual void | run (const char *nameOfTest, bool printDots)=0
| Run the test and record the name of the test as __nameOfTest.
Public Member Functions inherited from Test
| Test (const string &name)
| Construct a Test with the given name.
virtual | ~Test ()
const string & | getName () const
| Returns the name passed to the constructor.
bool | operator< (const Test &test) const
| Compares names lexicographically.

## Detailed Description

Represents a test case, which is usually created through a macro that defines a subclass.

This class is a leaf of the Composite Pattern, and can be visited by a TestVisitor according to the Visitor Pattern.

Definition at line 29 of file TestCase.h.

## Constructor & Destructor Documentation

## TestCase()

TestCase::TestCase | ( | const string & | name | ) |

Construct a test case with the given name.

Definition at line 22 of file TestCase.cpp.

## Member Function Documentation

## accept()

bool TestCase::accept | ( | TestVisitor & | visitor | ) |

virtual

Makes the visitor visit this object as per the Visitor Pattern.

Implements Test.

Definition at line 26 of file TestCase.cpp.

## run()

virtual void TestCase::run | ( | const char * | nameOfTest,
|  | bool | printDots )

pure virtual

Run the test and record the name of the test as __nameOfTest.

This can be a more detailed name, and it can be derived from the name that is returned by getName(), or it can be unrelated. This provides needed flexibility. printDots indicates whether to print dots when individual assertions succeed.

The documentation for this class was generated from the following files:

- src/test/TestCase.h
- src/test/TestCase.cpp