1 // ////////////////////////////////////////////////////////////////////////// 2 // Header file ExceptionTestCaseDecoratorTest.h for class ExceptionTestCaseDecoratorTest 3 // (c)Copyright 2000, Baptiste Lepilleur. 4 // Created: 2002/08/03 5 // ////////////////////////////////////////////////////////////////////////// 6 #ifndef EXCEPTIONTESTCASEDECORATORTEST_H 7 #define EXCEPTIONTESTCASEDECORATORTEST_H 8 9 #include <cppunit/extensions/HelperMacros.h> 10 #include <cppunit/TestResult.h> 11 #include "FailureException.h" 12 #include "MockTestCase.h" 13 #include "MockTestListener.h" 14 15 16 /// Unit tests for ExceptionTestCaseDecoratorTest 17 class ExceptionTestCaseDecoratorTest : public CPPUNIT_NS::TestFixture 18 { 19 CPPUNIT_TEST_SUITE( ExceptionTestCaseDecoratorTest ); 20 CPPUNIT_TEST( testNoExceptionThrownFailed ); 21 CPPUNIT_TEST( testExceptionThrownPass ); 22 CPPUNIT_TEST_SUITE_END(); 23 24 public: 25 /*! Constructs a ExceptionTestCaseDecoratorTest object. 26 */ 27 ExceptionTestCaseDecoratorTest(); 28 29 /// Destructor. 30 virtual ~ExceptionTestCaseDecoratorTest(); 31 32 void setUp(); 33 void tearDown(); 34 35 void testNoExceptionThrownFailed(); 36 void testExceptionThrownPass(); 37 38 private: 39 /// Prevents the use of the copy constructor. 40 ExceptionTestCaseDecoratorTest( const ExceptionTestCaseDecoratorTest &other ); 41 42 /// Prevents the use of the copy operator. 43 void operator =( const ExceptionTestCaseDecoratorTest &other ); 44 45 private: 46 typedef CPPUNIT_NS::ExceptionTestCaseDecorator<FailureException> FailureExceptionTestCase; 47 48 CPPUNIT_NS::TestResult *m_result; 49 MockTestListener *m_testListener; 50 MockTestCase *m_test; 51 FailureExceptionTestCase *m_decorator; 52 }; 53 54 55 56 // Inlines methods for ExceptionTestCaseDecoratorTest: 57 // --------------------------------------------------- 58 59 60 61 #endif // EXCEPTIONTESTCASEDECORATORTEST_H 62