-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestCalclator.cpp
executable file
·77 lines (62 loc) · 1.69 KB
/
TestCalclator.cpp
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
72
73
74
75
76
77
#include <vcl.h>
#pragma hdrstop
#include <TestFramework.hpp>
#include "Calclator.h"
class TTestCalclator : public TTestCase
{
public:
__fastcall virtual TTestCalclator(AnsiString name) : TTestCase(name) {}
virtual void __fastcall SetUp();
virtual void __fastcall TearDown();
__published:
void __fastcall Testplus();
};
void __fastcall TTestCalclator::SetUp()
{
}
void __fastcall TTestCalclator::TearDown()
{
}
void __fastcall TTestCalclator::Testplus()
{
//int plus(int, int);
Calclator aCalc;
CheckEquals(2, aCalc.plus(1,1));
CheckEquals(3, aCalc.plus(1,2));
CheckEquals(0, aCalc.plus(1,1));
}
static void registerTests()
{
_di_ITestSuite iSuite;
TTestSuite* testSuite = new TTestSuite("Testing Calclator.h");
if (testSuite->GetInterface(iSuite)) {
testSuite->AddTests(__classid(TTestCalclator));
Testframework::RegisterTest(iSuite);
} else {
delete testSuite;
}
}
#pragma startup registerTests 33
/* [For debug purposes only - To be removed soon!!]
GenerateHeaderComment=true
DefaultExtension=.cpp
FileName=C:\Documents and Settings\koba\My Documents\RAD Studio\Projects\TestCalclator.cpp
TestFramework=DUnit / C++ Win32
OutputPersonality=CPlusPlusBuilder.Personality
TestProject=C:\Documents and Settings\koba\My Documents\RAD Studio\Projects\Project1Tests.cbproj
UnitUnderTest=D:\workspace\buildersample\calculator3\Calclator.h
NameOfUnitUnderTest=Calclator.h
TestCaseBaseClass=TTestCase
TestCasePrefix=Test
UnitName=TestCalclator
Namespace=TestCalclator
TestClasses=
<0>
Name=Calclator
Methods=
<0>
Name=plus
Signature=int plus(int, int)
TestClass=
Method=
*/