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

easyunit::TestCase Class Reference

A TestCase is a collection of unit tests (instance of Test) and is always specified by the first parameter of a Test declaration. More...

#include <testcase.h>

List of all members.

Public Member Functions

 TestCase (const SimpleString &name, TestResult *testResult)
 Main TestCase constructor.
virtual ~TestCase ()
void addTest (Test *test)
 Add a Test to the Test list.
TestgetTests () const
 Get the Test list.
void run ()
 Execute all Tests in the Test list of this TestCase.
int getTestsCount () const
 Get the Test list size (number of Tests in this TestCase).
int getFailuresCount () const
 Get the total number of failures reported by all Tests.
int getSuccessesCount () const
 Get the total number of successes reported by all Tests.
int getErrorsCount () const
 Get the total number of errors reported by all Tests.
bool ran () const
 Indicates whether or not this TestCase was executed.
const SimpleStringgetName () const
 Get the TestCase name.
TestCasegetNext () const
 Get the next TestCase in the list.
void setNext (TestCase *testCase)
 Set the next TestCase in the list.

Protected Attributes

int failuresCount_
int successesCount_
int errorsCount_
int testsCount_
Testtests_
SimpleString name_
TestCasenextTestCase_
TestResulttestResult_

Private Member Functions

void updateCount (Test *test)
void runTests (Test *test)
void runTest (Test *test)

Private Attributes

bool ran_


Detailed Description

A TestCase is a collection of unit tests (instance of Test) and is always specified by the first parameter of a Test declaration.


Constructor & Destructor Documentation

easyunit::TestCase::TestCase const SimpleString name,
TestResult testResult
 

Main TestCase constructor.

Parameters:
name TestCase name
testResult Pointer to the TestResult used to report results of executed Test

virtual easyunit::TestCase::~TestCase  )  [virtual]
 


Member Function Documentation

void easyunit::TestCase::addTest Test test  ) 
 

Add a Test to the Test list.

This method is used by TestRegistry.

Parameters:
test Test instance to add to the Test list.

int easyunit::TestCase::getErrorsCount  )  const
 

Get the total number of errors reported by all Tests.

Returns:
The total number of errors reported by all Tests. 0 if no test were run, if this is the embedded version or if no errors were reported.

int easyunit::TestCase::getFailuresCount  )  const
 

Get the total number of failures reported by all Tests.

Returns:
The total number of failures reported by all Tests. 0 if no test were run or if no failures were reported.

const SimpleString& easyunit::TestCase::getName  )  const
 

Get the TestCase name.

This name is specified by the first parameter of the Test declaration. For example, if a test was declared as TEST(TESTCASE1, TEST1), the TestCase name would be "TESTCASE1".

Returns:
The name of the TestCase

TestCase* easyunit::TestCase::getNext  )  const
 

Get the next TestCase in the list.

Returns:
The next TestCase in the TestCase linked list

int easyunit::TestCase::getSuccessesCount  )  const
 

Get the total number of successes reported by all Tests.

Returns:
The total number of successes reported by all Tests. 0 if no test were run or if no successes were reported.

Test* easyunit::TestCase::getTests  )  const
 

Get the Test list.

Returns:
Test list

int easyunit::TestCase::getTestsCount  )  const
 

Get the Test list size (number of Tests in this TestCase).

Returns:
The Test list size

bool easyunit::TestCase::ran  )  const
 

Indicates whether or not this TestCase was executed.

Returns:
true if the method run() of this TestCase was called. false otherwise

void easyunit::TestCase::run  ) 
 

Execute all Tests in the Test list of this TestCase.

In fact, it calls the run() method of all Tests.

void easyunit::TestCase::runTest Test test  )  [private]
 

void easyunit::TestCase::runTests Test test  )  [private]
 

void easyunit::TestCase::setNext TestCase testCase  ) 
 

Set the next TestCase in the list.

Returns:
The next TestCase in the TestCase linked list

void easyunit::TestCase::updateCount Test test  )  [private]
 


Member Data Documentation

int easyunit::TestCase::errorsCount_ [protected]
 

int easyunit::TestCase::failuresCount_ [protected]
 

SimpleString easyunit::TestCase::name_ [protected]
 

TestCase* easyunit::TestCase::nextTestCase_ [protected]
 

bool easyunit::TestCase::ran_ [private]
 

int easyunit::TestCase::successesCount_ [protected]
 

TestResult* easyunit::TestCase::testResult_ [protected]
 

Test* easyunit::TestCase::tests_ [protected]
 

int easyunit::TestCase::testsCount_ [protected]
 


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