class TestCase : Test

Base implementation of a test case.

This class is intended to be used as base class for "real" test cases. It provides a default implementation of the required functionality of a test case.



Public Members:
    TestCase (const string& name) ;
    The constructor.
    Only the name is set.

    virtual bool run (TestConductor& conductor) ;
    Executes the test case with the help of the given test conductor.
    Simply delegates testing to the execute method of the test conductor so that set-up, test and tear-down functions are called while ensuring a well defined behaviour.

    virtual void setUp () ;
    Construction of the test fixture.
    Dummy implementation. Has no functionality.

    virtual void test (TestConductor&) ;
    Perform the test activity.
    The only thing this function does is to call the parameterless test method (see below) to execute the test of application domain functionality.

    virtual void test () ;
    Execute the test.
    In case something doesn't behave as expected, a TestFailure should be thrown. Otherwise the function simply returns.

    virtual void tearDown () ;
    Deconstruction of the test fixture.
    Dummy implementation. Has no functionality.

    virtual bool isTestCase () const ;
    Tests if an instance is a test case.
    Returns always true.

    virtual int noTestCases () const ;
    Counts the number of (directly or indirectly) contained test cases.
    Returns always 1.

    virtual int noTestSuites () const ;
    Counts the number of (directly or indirectly) contained test suites.
    Returns always 0.

    virtual void put (ostream& stream) const ;
    Output the test case to the stream.
    The string "Test case: " and the name is printed.




The Scrunitizer C++ Unit Test Framework
by Bernd Linowski

[Scrunitizer]  [Overview]  [Cookbook]  [Download]  [Index]  [Linosphere]

Page generated: 1 Nov 2000
(C) by Bernd Linowski
scrunitizer@linosphere.de