File: TestDecoratorTest.cpp

package info (click to toggle)
squid3 3.0.PRE5-5%2Betch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 21,188 kB
  • ctags: 20,388
  • sloc: cpp: 119,851; ansic: 30,259; sh: 10,465; makefile: 3,289; perl: 1,267; awk: 84; xml: 58
file content (61 lines) | stat: -rw-r--r-- 1,042 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "ExtensionSuite.h"
#include "TestDecoratorTest.h"
#include <cppunit/TestResult.h>


CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( TestDecoratorTest,
                                       extensionSuiteName() );


TestDecoratorTest::TestDecoratorTest()
{
}


TestDecoratorTest::~TestDecoratorTest()
{
}


void 
TestDecoratorTest::setUp()
{
  m_test = new MockTestCase( "mocktest" );
  m_decorator = new CPPUNIT_NS::TestDecorator( m_test );
}


void 
TestDecoratorTest::tearDown()
{
  delete m_decorator;
}


void 
TestDecoratorTest::testCountTestCases()
{
  m_test->setExpectedCountTestCasesCall( 1 );
  CPPUNIT_ASSERT_EQUAL( 1, m_decorator->countTestCases() );
  m_test->verify();
}


void 
TestDecoratorTest::testRun()
{
  m_test->setExpectedSetUpCall( 1 );
  m_test->setExpectedRunTestCall( 1 );
  m_test->setExpectedTearDownCall( 1 );
  CPPUNIT_NS::TestResult result;

  m_decorator->run( &result );
  m_test->verify();
}


void 
TestDecoratorTest::testGetName()
{
  CPPUNIT_ASSERT_EQUAL( m_test->getName(), m_decorator->getName() );
}