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

cppunit::TestCaller Class Template Reference

メソッドをテストケースに変換するアダプタ。
Generate a test case from a fixture method. More...

#include <TestCaller.h>

Inheritance diagram for cppunit::TestCaller::

cppunit::Test List of all members.

Public Types

typedef void(Fixture::* TestMethod )()

Public Methods

 TestCaller (const char *name, TestMethod method)
 コンストラクタ。
.
More...


virtual void run (TestResult *result)
 テストを実行し、結果を集める。
Run the test, collecting results.
More...


virtual int countTestCases () const
 テストケースの個数を返す。
Return the number of test cases invoked by run().
More...


virtual const char * getName () const
 テストの名前を返す。
Returns the test name.
More...


virtual cu_String toString () const
 文字列に変換する。
Description of the test, for diagnostic output.
More...


const Fixturefixture () const
 Fixture を返す。. More...


Detailed Description

template<class Fixture>
class cppunit::TestCaller< Fixture >

メソッドをテストケースに変換するアダプタ。
Generate a test case from a fixture method.

A test caller provides access to a test case method on a test case class.
Test callers are useful when you want to run an individual test or add it to a suite.
Test Callers invoke only one Test (i.e. test method) on one Fixture of a TestCase.
Here is an example:

 class MathTest : public TestCase {
     ...
   public:
     virtual void setUp();
     virtual void tearDown();

     void testAdd();
     void testSubtract();

     static Test* suite();
 };

 Test* MathTest::suite() {
     TestSuite* suite = new TestSuite("MathTest");
     suite->addTest(new TEST_CALLER(MathTest, testAdd));
     return suite;
 }
 

You can use a TestCaller to bind any test method on a TestCase class,
as long as it accepts void and returns void.

See also:
TestCase


Member Typedef Documentation

template<class Fixture>
typedef void(Fixture::* cppunit::TestCaller::TestMethod)()
 


Constructor & Destructor Documentation

template<class Fixture>
cppunit::TestCaller< Fixture >::TestCaller const char *    name,
TestMethod    method
[inline]
 

コンストラクタ。
.

Parameters:
name  テストの名前。
method  テストメソッド。


Member Function Documentation

template<class Fixture>
virtual void cppunit::TestCaller< Fixture >::run TestResult   result [inline, virtual]
 

テストを実行し、結果を集める。
Run the test, collecting results.

Parameters:
result  テスト結果。

Reimplemented from cppunit::Test.

template<class Fixture>
virtual int cppunit::TestCaller< Fixture >::countTestCases   const [inline, virtual]
 

テストケースの個数を返す。
Return the number of test cases invoked by run().

The base unit of testing is the class TestCase.
This method returns the number of TestCase objects invoked by the run() method.

Reimplemented from cppunit::Test.

template<class Fixture>
virtual const char* cppunit::TestCaller< Fixture >::getName   const [inline, virtual]
 

テストの名前を返す。
Returns the test name.

Each test has a name. This name may be used to find the test in a suite of tests.

Reimplemented from cppunit::Test.

template<class Fixture>
virtual cu_String cppunit::TestCaller< Fixture >::toString   const [inline, virtual]
 

文字列に変換する。
Description of the test, for diagnostic output.

The test description will typically include the test name, but may have additional description.
For example, a test suite named ComplexTest may be described as suite ComplexTest.

Reimplemented from cppunit::Test.

template<class Fixture>
const Fixture* cppunit::TestCaller< Fixture >::fixture   const [inline]
 

Fixture を返す。.


The documentation for this class was generated from the following file:
Generated on Sun Mar 31 23:42:08 2002 for CppUnit-x by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001