-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.bas
78 lines (62 loc) · 1.89 KB
/
test.bas
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
78
#include "fbtesting.bi"
using fbtesting
sub CallFail(byref t as Testing)
t.Fail()
end sub
sub CallError(byref t as Testing)
t.Error("Error called.")
end sub
sub Pass(byref t as Testing)
end sub
sub CallSkipError(byref t as Testing)
t.Skip()
t.Error("skipped error")
end sub
sub CallErrorSkip(byref t as Testing)
t.Error("not skipped error")
t.Skip()
end sub
dim tester as Testing = Testing("fbtesting")
sub TestEmpty(byref t as Testing)
dim myTester as Testing = Testing()
myTester.Run()
if myTester.Failed() then t.Error("Expected test to pass but it failed.")
end sub
sub TestPass(byref t as Testing)
dim myTester as Testing = Testing()
myTester.Test(@pass)
myTester.Run()
if myTester.Failed() then t.Error("Expected test to pass but it failed.")
end sub
sub TestFail(byref t as Testing)
dim myTester as Testing = Testing()
myTester.Test(@CallFail)
myTester.Run()
if not myTester.Failed() then t.Error("Expected test to fail but it passed.")
end sub
sub TestError(byref t as Testing)
dim myTester as Testing = Testing()
myTester.Test(@CallError)
myTester.Run()
if not myTester.Failed() then t.Error("Expected test to fail but it passed.")
end sub
sub TestSkip(byref t as Testing)
dim myTester as Testing = Testing()
myTester.Test(@CallSkipError)
myTester.Run()
if myTester.Failed() then t.Error("Expected test to pass but it failed.")
end sub
sub TestSkipError(byref t as Testing)
dim myTester as Testing = Testing()
myTester.Test(@CallErrorSkip)
myTester.Run()
if not myTester.Failed() then t.Error("Expected test to fail but it passed.")
end sub
tester.Test(@TestEmpty, "Test empty")
tester.Test(@TestPass, "Test passing")
tester.Test(@TestFail, "Test Fail")
tester.Test(@TestError, "Test Error")
tester.Test(@TestSkip, "Test Skip")
tester.Test(@TestSkipError, "Test fail Skip")
tester.Run()
if tester.Failed() then end 1