blob: 177303809a7684e6f3153ee403e210b1e343d47e (
plain)
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
62
63
64
65
66
67
68
69
70
71
|
// //////////////////////////////////////////////////////////////////////////
// Implementation file ExceptionTestCaseDecoratorTest.cpp for class ExceptionTestCaseDecoratorTest
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: 2002/08/03
// //////////////////////////////////////////////////////////////////////////
#include "ExtensionSuite.h"
#include "ExceptionTestCaseDecoratorTest.h"
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ExceptionTestCaseDecoratorTest,
extensionSuiteName() );
ExceptionTestCaseDecoratorTest::ExceptionTestCaseDecoratorTest()
{
}
ExceptionTestCaseDecoratorTest::~ExceptionTestCaseDecoratorTest()
{
}
void
ExceptionTestCaseDecoratorTest::setUp()
{
m_testListener = new MockTestListener( "mock-testlistener" );
m_result = new CPPUNIT_NS::TestResult();
m_result->addListener( m_testListener );
m_test = new MockTestCase( "mock-decorated-testcase" );
m_decorator = new FailureExceptionTestCase( m_test );
}
void
ExceptionTestCaseDecoratorTest::tearDown()
{
delete m_decorator;
delete m_result;
delete m_testListener;
}
void
ExceptionTestCaseDecoratorTest::testNoExceptionThrownFailed()
{
m_testListener->setExpectedAddFailureCall(1);
m_test->setExpectedSetUpCall();
m_test->setExpectedRunTestCall();
m_test->setExpectedTearDownCall();
m_decorator->run( m_result );
m_testListener->verify();
}
void
ExceptionTestCaseDecoratorTest::testExceptionThrownPass()
{
m_testListener->setExpectNoFailure();
m_test->setExpectedSetUpCall();
m_test->setExpectedRunTestCall();
m_test->setExpectedTearDownCall();
m_test->makeRunTestThrow();
m_decorator->run( m_result );
m_testListener->verify();
}
|