1#ifndef CPPUNIT_TESTCASE_H
2#define CPPUNIT_TESTCASE_H
3
4#include <cppunit/Portability.h>
5#include <cppunit/Test.h>
6#include <cppunit/TestAssert.h>
7#include <cppunit/TestFixture.h>
8#include <string>
9
10
11namespace CppUnit {
12
13class TestResult;
14
15
16/*! \brief A single test object.
17 *
18 * This class is used to implement a simple test case: define a subclass
19 * that overrides the runTest method.
20 *
21 * You don't usually need to use that class, but TestFixture and TestCaller instead.
22 *
23 * You are expected to subclass TestCase is you need to write a class similiar
24 * to TestCaller.
25 */
26class CPPUNIT_API TestCase : public Test,
27                             public TestFixture
28{
29public:
30
31    TestCase( std::string Name );
32    //! \internal
33    TestCase();
34    ~TestCase();
35
36    virtual void run(TestResult *result);
37    virtual int countTestCases() const;
38    std::string getName() const;
39    std::string toString() const;
40
41    //! FIXME: what is this for?
42    virtual TestResult *run();
43
44protected:
45    //! FIXME: this should probably be pure virtual.
46    virtual void runTest();
47
48    //! Create TestResult for the run(void) method.
49    TestResult *defaultResult();
50
51private:
52    TestCase( const TestCase &other );
53    TestCase &operator=( const TestCase &other );
54
55private:
56    const std::string m_name;
57};
58
59} // namespace CppUnit
60
61#endif // CPPUNIT_TESTCASE_H
62