-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestFixture.bas
57 lines (44 loc) · 1.44 KB
/
TestFixture.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
Attribute VB_Name = "TestFixture"
Option Explicit
Option Private Module
'@TestModule
'@Folder("Tests")
Private Assert As Object
Private Fakes As Object
'@ModuleInitialize
Private Sub ModuleInitialize()
'this method runs once per module.
Set Assert = CreateObject("Rubberduck.AssertClass")
Set Fakes = CreateObject("Rubberduck.FakesProvider")
End Sub
'@ModuleCleanup
Private Sub ModuleCleanup()
'this method runs once per module.
Set Assert = Nothing
Set Fakes = Nothing
End Sub
'@TestInitialize
Private Sub TestInitialize()
'this method runs before every test in the module.
End Sub
'@TestCleanup
Private Sub TestCleanup()
'this method runs after every test in the module.
End Sub
'@TestMethod("Uncategorized")
Private Sub TestFixtureCanBePopulatedWithData()
On Error GoTo TestFail
'Arrange:
Dim oFixtureHelper As FixtureHelper
Set oFixtureHelper = New FixtureHelper
Dim expected, actual As Fixture
Set expected = oFixtureHelper.CreateFixture(14, DateValue("2020-05-01"), "Test Team 1", "Test Team 2", "8~2", "https://www.tabletennis365.com/")
'Act:
Set actual = oFixtureHelper.CreateFixture(14, DateValue("2020-05-01"), "Test Team 1", "Test Team 2", "8~2", "https://www.tabletennis365.com/")
'Assert:
Assert.IsTrue expected.IsEquivalent(actual)
TestExit:
Exit Sub
TestFail:
Assert.Fail "Test raised an error: #" & Err.Number & " - " & Err.Description
End Sub