Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

easyunit::TestRegistry Class Reference

The TestRegistry is the main class used to register all tests, and create appropriate TestCase. More...

#include <testregistry.h>

List of all members.

Public Member Functions

 TestRegistry ()
 ~TestRegistry ()

Static Public Member Functions

void addTest (Test *test)
 Add a test in the registry.
const TestResultrun ()
 Run all tests in the registry (default test runner) and return the test results.
const TestResultrun (TestRunner *runner)
 Pass all tests in the registry to the TestRunner runner and return the results of all tests ran.
const TestResultrunAndPrint ()
 Run all tests in the registry (default test runner) and return the test results.
const TestResultrunAndPrint (TestRunner *runner)
 Pass all tests in the registry to the TestRunner runner and return the results of all tests ran.
const TestResultrunAndPrint (TestPrinter *printer)
 Run all tests in the registry (default test runner) and return the test results.
const TestResultrunAndPrint (TestPrinter *printer, TestRunner *runner)
 Pass all tests in the registry to the TestRunner runner and return the results of all tests ran.

Private Member Functions

void add (Test *test)
void addTestCase (TestCase *testCase)
const TestResultrunTests (TestRunner *runner)

Static Private Member Functions

TestRegistryinstance ()

Private Attributes

int testCaseCount_
TestCasecurrentTC_
TestPrinterdefaultPrinter_
TestRunnerdefaultRunner_
TestResult testResult_

Static Private Attributes

int nextName


Detailed Description

The TestRegistry is the main class used to register all tests, and create appropriate TestCase.

It can then be used to run tests and print results. All methods that should be used by the user are static.


Constructor & Destructor Documentation

easyunit::TestRegistry::TestRegistry  ) 
 

easyunit::TestRegistry::~TestRegistry  ) 
 


Member Function Documentation

void easyunit::TestRegistry::add Test test  )  [private]
 

void easyunit::TestRegistry::addTest Test test  )  [static]
 

Add a test in the registry.

If the previous TestCase was not the same as the one of the current test, a new TestCase is created.

Parameters:
test Test to be added

void easyunit::TestRegistry::addTestCase TestCase testCase  )  [private]
 

TestRegistry& easyunit::TestRegistry::instance  )  [static, private]
 

const TestResult* easyunit::TestRegistry::run TestRunner runner  )  [static]
 

Pass all tests in the registry to the TestRunner runner and return the results of all tests ran.

Parameters:
runner The custom runner used to decided which test to run
Returns:
The test results of all tests ran

const TestResult* easyunit::TestRegistry::run  )  [static]
 

Run all tests in the registry (default test runner) and return the test results.

Returns:
The test results

const TestResult* easyunit::TestRegistry::runAndPrint TestPrinter printer,
TestRunner runner
[static]
 

Pass all tests in the registry to the TestRunner runner and return the results of all tests ran.

Results will also be given to to the TestPrinter printer.

Parameters:
printer The custom printer used to print the test results
runner The custom runner used to decided which test to run
Returns:
The test results

const TestResult* easyunit::TestRegistry::runAndPrint TestPrinter printer  )  [static]
 

Run all tests in the registry (default test runner) and return the test results.

Results will also be given to to the TestPrinter printer.

Parameters:
printer The custom printer used to print the test results
Returns:
The test results

const TestResult* easyunit::TestRegistry::runAndPrint TestRunner runner  )  [static]
 

Pass all tests in the registry to the TestRunner runner and return the results of all tests ran.

This will also print the results using the default test printer (normal level of details and to the standard output).

Parameters:
runner The custom runner used to decided which test to run
Returns:
The test results

const TestResult* easyunit::TestRegistry::runAndPrint  )  [static]
 

Run all tests in the registry (default test runner) and return the test results.

This will also print the results using the default test printer (normal level of details and to the standard output).

Returns:
The test results

const TestResult* easyunit::TestRegistry::runTests TestRunner runner  )  [private]
 


Member Data Documentation

TestCase* easyunit::TestRegistry::currentTC_ [private]
 

TestPrinter* easyunit::TestRegistry::defaultPrinter_ [private]
 

TestRunner* easyunit::TestRegistry::defaultRunner_ [private]
 

int easyunit::TestRegistry::nextName [static, private]
 

int easyunit::TestRegistry::testCaseCount_ [private]
 

TestResult easyunit::TestRegistry::testResult_ [private]
 


The documentation for this class was generated from the following file:
Generated on Fri Mar 4 09:51:25 2005 for EasyUnit by doxygen 1.3.8