-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathM_clsLogFilter_Test.def
67 lines (56 loc) · 1.5 KB
/
M_clsLogFilter_Test.def
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
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Compare Text
Option Explicit
'AccUnit:TestClass
Dim objFilter As clsLogFilter
Dim objEntry As clsLogEntry
Public Sub Setup()
Set objFilter = New clsLogFilter
Set objEntry = New clsLogEntry
' Arrange
With objEntry
.Severity = Sev_Critical
.MessageNumber = 1234
.MessageText = "Dummy"
End With
End Sub
Public Sub Teardown()
Set objFilter = Nothing
End Sub
Public Sub NewFilter_MatchesEverything()
' Assert
Assert.IsTrue objFilter.IsMatch(objEntry)
End Sub
Public Sub Filter_WithSevCritical_MatchesEntry()
' Arrange
objFilter.WithSeverity Sev_Critical
' Assert
Assert.IsTrue objFilter.IsMatch(objEntry)
End Sub
Public Sub Filter_WithSevDebug_DoesNotMatchEntry()
' Arrange
objFilter.WithSeverity Sev_Debug
' Assert
Assert.IsFalse objFilter.IsMatch(objEntry)
End Sub
Public Sub Filter_WithNumberEqualTo1234_MatchesEntry()
' Arrange
objFilter.WithMessageNumber EqualTo, 1234
' Assert
Assert.IsTrue objFilter.IsMatch(objEntry)
End Sub
Public Sub Filter_WithDummyText_MatchesEntry()
' Arrange
objFilter.WithMessageText IsEqualTo, "Dummy"
' Assert
Assert.IsTrue objFilter.IsMatch(objEntry)
End Sub
Public Sub Filter_WithOtherText_MatchesEntry()
' Arrange
objFilter.WithMessageText Contains, "Other"
' Assert
Assert.IsFalse objFilter.IsMatch(objEntry)
End Sub