Name
TestSetUp
Description
The class TestSetUp
(see Figure C-29) is a
subclass of TestDecorator that implements
setUp( ) and tearDown( )
methods for the decorated Test. This allows the
Test object’s test fixture
behavior to be modified without subclassing it.
TestSetUp belongs to the namespace
CppUnit. It is declared in the file
extensions/TestSetUp.h and implemented in the
file TestSetUp.cpp.
![]() |
Declaration
class TestSetUp : public TestDecorator
Constructors/Destructors
-
TestSetUp(Test *test) A constructor taking the
Testto decorate.
Public Methods
-
void run(TestResult *result) Calls
setUp( ), runs the decoratedTest, and callstearDown( ).
Protected/Private Methods
-
virtual void setUp( ) A
Protectedmethod called prior to running the decoratedTest, allowing custom test fixture behavior to be implemented.-
virtual void tearDown( ) A
Protectedmethod called after running the decoratedTest, allowing the test fixture to be cleaned up.-
TestSetUp(const TestSetUp &) A copy constructor declared
privateto prevent its use.-
void operator=(const TestSetUp &) A copy operator declared
privateto prevent its use.
Attributes
None.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
