Frobby  0.9.5
Public Types | Public Member Functions | Private Attributes | List of all members
TestSuite Class Reference

Represents a collection of tests, be they individual tests or yet other collections of tests. More...

#include <TestSuite.h>

Inheritance diagram for TestSuite:
Test

Public Types

typedef vector< Test * >::iterator TestIterator
 An iterator for the added tests. More...
 

Public Member Functions

 TestSuite (const string &name)
 Constructs a test suite with the given name. More...
 
void add (Test *test)
 Adds a test to the test suite. More...
 
void sortTests ()
 Sorts the added tests in some canonical order. More...
 
TestIterator begin ()
 Returns an iterator to the beginning of the range of added tests. More...
 
TestIterator end ()
 Returns an iterator just past the end of the range of added tests. More...
 
virtual bool accept (TestVisitor &visitor)
 Makes the visitor visit this object as per the Visitor Pattern. More...
 
- Public Member Functions inherited from Test
 Test (const string &name)
 Construct a Test with the given name. More...
 
virtual ~Test ()
 
const string & getName () const
 Returns the name passed to the constructor. More...
 
bool operator< (const Test &test) const
 Compares names lexicographically. More...
 

Private Attributes

vector< Test * > _tests
 The collection of tests of added tests. More...
 

Detailed Description

Represents a collection of tests, be they individual tests or yet other collections of tests.

This class is a composite as per the Composite pattern, and can be visited by a TestVisitor according to the Visitor Pattern.

Definition at line 28 of file TestSuite.h.

Member Typedef Documentation

◆ TestIterator

typedef vector<Test*>::iterator TestSuite::TestIterator

An iterator for the added tests.

Definition at line 42 of file TestSuite.h.

Constructor & Destructor Documentation

◆ TestSuite()

TestSuite::TestSuite ( const string &  name)

Constructs a test suite with the given name.

Definition at line 23 of file TestSuite.cpp.

Member Function Documentation

◆ accept()

bool TestSuite::accept ( TestVisitor visitor)
virtual

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

Implements Test.

Definition at line 55 of file TestSuite.cpp.

◆ add()

void TestSuite::add ( Test test)

Adds a test to the test suite.

This can be another TestSuite or an individual TestCase.

Definition at line 27 of file TestSuite.cpp.

◆ begin()

TestSuite::TestIterator TestSuite::begin ( )

Returns an iterator to the beginning of the range of added tests.

Definition at line 47 of file TestSuite.cpp.

◆ end()

TestSuite::TestIterator TestSuite::end ( )

Returns an iterator just past the end of the range of added tests.

Definition at line 51 of file TestSuite.cpp.

◆ sortTests()

void TestSuite::sortTests ( )

Sorts the added tests in some canonical order.

Definition at line 43 of file TestSuite.cpp.

Member Data Documentation

◆ _tests

vector<Test*> TestSuite::_tests
private

The collection of tests of added tests.

Definition at line 58 of file TestSuite.h.


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