1 #include "ExtensionSuite.h" 2 #include "TestDecoratorTest.h" 3 #include <cppunit/TestResult.h> 4 5 6 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TestDecoratorTest, 7 extensionSuiteName() ); 8 9 TestDecoratorTest()10TestDecoratorTest::TestDecoratorTest() 11 { 12 } 13 14 ~TestDecoratorTest()15TestDecoratorTest::~TestDecoratorTest() 16 { 17 } 18 19 20 void setUp()21TestDecoratorTest::setUp() 22 { 23 m_test = new MockTestCase( "mocktest" ); 24 m_decorator = new CPPUNIT_NS::TestDecorator( m_test ); 25 } 26 27 28 void tearDown()29TestDecoratorTest::tearDown() 30 { 31 delete m_decorator; 32 } 33 34 35 void testCountTestCases()36TestDecoratorTest::testCountTestCases() 37 { 38 m_test->setExpectedCountTestCasesCall( 1 ); 39 CPPUNIT_ASSERT_EQUAL( 1, m_decorator->countTestCases() ); 40 m_test->verify(); 41 } 42 43 44 void testRun()45TestDecoratorTest::testRun() 46 { 47 m_test->setExpectedSetUpCall( 1 ); 48 m_test->setExpectedRunTestCall( 1 ); 49 m_test->setExpectedTearDownCall( 1 ); 50 CPPUNIT_NS::TestResult result; 51 52 m_decorator->run( &result ); 53 m_test->verify(); 54 } 55 56 57 void testGetName()58TestDecoratorTest::testGetName() 59 { 60 CPPUNIT_ASSERT_EQUAL( m_test->getName(), m_decorator->getName() ); 61 } 62