CppUnit project page FAQ CppUnit home page

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TestCase Class Reference

A single test object. More...

#include <TestCase.h>

Inheritance diagram for TestCase:

Inheritance graph
[legend]
Collaboration diagram for TestCase:

Collaboration graph
[legend]
List of all members.

Public Methods

 TestCase (const std::string &name)
 Constructs a test case. More...

 TestCase ()
 Constructs a test case for a suite. More...

 ~TestCase ()
 Destructs a test case. More...

virtual void run (TestResult *result)
 Run the test and catch any exceptions that are triggered by it. More...

std::string getName () const
 Returns the name of the test case. More...

virtual void runTest ()
 FIXME: this should probably be pure virtual. More...


Private Methods

 TestCase (const TestCase &other)
TestCase & operator= (const TestCase &other)

Private Attributes

const std::string m_name

Detailed Description

A single test object.

This class is used to implement a simple test case: define a subclass that overrides the runTest method.

You don't usually need to use that class, but TestFixture and TestCaller instead.

You are expected to subclass TestCase is you need to write a class similiar to TestCaller.


Constructor & Destructor Documentation

TestCase::TestCase const std::string &    name
 

Constructs a test case.

Parameters:
name  the name of the TestCase.

TestCase::TestCase  
 

Constructs a test case for a suite.

Deprecated:
This constructor was used by fixture when TestFixture did not exist. Have your fixture inherits TestFixture instead of TestCase.

TestCase::~TestCase  
 

Destructs a test case.

TestCase::TestCase const TestCase &    other [private]
 


Member Function Documentation

std::string TestCase::getName   const [virtual]
 

Returns the name of the test case.

Implements Test.

Reimplemented in TestCaseDecorator.

TestCase& TestCase::operator= const TestCase &    other [private]
 

void TestCase::run TestResult   result [virtual]
 

Run the test and catch any exceptions that are triggered by it.

Implements Test.

void TestCase::runTest   [virtual]
 

FIXME: this should probably be pure virtual.

Reimplemented in ExceptionTestCaseDecorator.


Member Data Documentation

const std::string TestCase::m_name [private]
 


The documentation for this class was generated from the following files:
SourceForge Logo hosts this site. Send comments to:
CppUnit Developers