@@ -22,7 +22,7 @@ public void NoFilter_AnyElement_ElementIsAccepted()
22
22
[ Fact ]
23
23
public void OnlyIncludes_MatchingElement_ElementIsAccepted ( )
24
24
{
25
- IFilter filter = new DefaultFilter ( new [ ] { "+Test" } ) ;
25
+ IFilter filter = new DefaultFilter ( [ "+Test" ] ) ;
26
26
27
27
Assert . True ( filter . IsElementIncludedInReport ( "Test" ) , "Element is expected to be included." ) ;
28
28
Assert . True ( filter . IsElementIncludedInReport ( "test" ) , "Element is expected to be included." ) ;
@@ -32,7 +32,7 @@ public void OnlyIncludes_MatchingElement_ElementIsAccepted()
32
32
[ Fact ]
33
33
public void OnlyIncludes_NotMatchingElement_ElementIsNotAccepted ( )
34
34
{
35
- IFilter filter = new DefaultFilter ( new [ ] { "+Test" } ) ;
35
+ IFilter filter = new DefaultFilter ( [ "+Test" ] ) ;
36
36
37
37
Assert . False ( filter . IsElementIncludedInReport ( "Test123" ) , "Element is expected to be excluded." ) ;
38
38
Assert . False ( filter . IsElementIncludedInReport ( "test123" ) , "Element is expected to be excluded." ) ;
@@ -42,7 +42,7 @@ public void OnlyIncludes_NotMatchingElement_ElementIsNotAccepted()
42
42
[ Fact ]
43
43
public void OnlyIncludesWithWildcards_MatchingElement_ElementIsAccepted ( )
44
44
{
45
- IFilter filter = new DefaultFilter ( new [ ] { "+Test*" } ) ;
45
+ IFilter filter = new DefaultFilter ( [ "+Test*" ] ) ;
46
46
47
47
Assert . True ( filter . IsElementIncludedInReport ( "Test" ) , "Element is expected to be included." ) ;
48
48
Assert . True ( filter . IsElementIncludedInReport ( "test" ) , "Element is expected to be included." ) ;
@@ -54,7 +54,7 @@ public void OnlyIncludesWithWildcards_MatchingElement_ElementIsAccepted()
54
54
[ Fact ]
55
55
public void OnlyIncludesWithWildcards_NotMatchingElement_ElementIsNotAccepted ( )
56
56
{
57
- IFilter filter = new DefaultFilter ( new [ ] { "+Test*" } ) ;
57
+ IFilter filter = new DefaultFilter ( [ "+Test*" ] ) ;
58
58
59
59
Assert . False ( filter . IsElementIncludedInReport ( "PrefixTest" ) , "Element is expected to be excluded." ) ;
60
60
Assert . False ( filter . IsElementIncludedInReport ( "prefixtest" ) , "Element is expected to be excluded." ) ;
@@ -66,7 +66,7 @@ public void OnlyIncludesWithWildcards_NotMatchingElement_ElementIsNotAccepted()
66
66
[ Fact ]
67
67
public void IncludesAndExcludes_MatchingElement_ElementIsAccepted ( )
68
68
{
69
- IFilter filter = new DefaultFilter ( new [ ] { "+Test" , "-SomeExclude" } ) ;
69
+ IFilter filter = new DefaultFilter ( [ "+Test" , "-SomeExclude" ] ) ;
70
70
71
71
Assert . True ( filter . IsElementIncludedInReport ( "Test" ) , "Element is expected to be included." ) ;
72
72
Assert . True ( filter . IsElementIncludedInReport ( "test" ) , "Element is expected to be included." ) ;
@@ -76,7 +76,7 @@ public void IncludesAndExcludes_MatchingElement_ElementIsAccepted()
76
76
[ Fact ]
77
77
public void IncludesAndExcludes_NotMatchingElement_ElementIsNotAccepted ( )
78
78
{
79
- IFilter filter = new DefaultFilter ( new [ ] { "+Test" , "-Test" } ) ;
79
+ IFilter filter = new DefaultFilter ( [ "+Test" , "-Test" ] ) ;
80
80
81
81
Assert . False ( filter . IsElementIncludedInReport ( "Test" ) , "Element is expected to be excluded." ) ;
82
82
Assert . False ( filter . IsElementIncludedInReport ( "test" ) , "Element is expected to be excluded." ) ;
@@ -86,7 +86,7 @@ public void IncludesAndExcludes_NotMatchingElement_ElementIsNotAccepted()
86
86
[ Fact ]
87
87
public void IncludesAndExcludesWithWildcards_MatchingElement_ElementIsAccepted ( )
88
88
{
89
- IFilter filter = new DefaultFilter ( new [ ] { "+Test*" , "-SomeExclude*" } ) ;
89
+ IFilter filter = new DefaultFilter ( [ "+Test*" , "-SomeExclude*" ] ) ;
90
90
91
91
Assert . True ( filter . IsElementIncludedInReport ( "Test" ) , "Element is expected to be included." ) ;
92
92
Assert . True ( filter . IsElementIncludedInReport ( "test" ) , "Element is expected to be included." ) ;
@@ -98,7 +98,7 @@ public void IncludesAndExcludesWithWildcards_MatchingElement_ElementIsAccepted()
98
98
[ Fact ]
99
99
public void IncludesAndExcludesWithWildcards_NotMatchingElement_ElementIsNotAccepted ( )
100
100
{
101
- IFilter filter = new DefaultFilter ( new [ ] { "+Test*" , "-Tes*" } ) ;
101
+ IFilter filter = new DefaultFilter ( [ "+Test*" , "-Tes*" ] ) ;
102
102
103
103
Assert . False ( filter . IsElementIncludedInReport ( "Test" ) , "Element is expected to be excluded." ) ;
104
104
Assert . False ( filter . IsElementIncludedInReport ( "test" ) , "Element is expected to be excluded." ) ;
@@ -110,7 +110,7 @@ public void IncludesAndExcludesWithWildcards_NotMatchingElement_ElementIsNotAcce
110
110
[ Fact ]
111
111
public void LinuxPath_NoOsIndependantPathSeparator ( )
112
112
{
113
- IFilter filter = new DefaultFilter ( new [ ] { "+abc/def" } ) ;
113
+ IFilter filter = new DefaultFilter ( [ "+abc/def" ] ) ;
114
114
115
115
Assert . True ( filter . IsElementIncludedInReport ( "abc/def" ) , "Element is expected to be included." ) ;
116
116
Assert . False ( filter . IsElementIncludedInReport ( "abc\\ def" ) , "Element is expected to be excluded." ) ;
@@ -120,7 +120,7 @@ public void LinuxPath_NoOsIndependantPathSeparator()
120
120
[ Fact ]
121
121
public void LinuxPath_OsIndependantPathSeparator ( )
122
122
{
123
- IFilter filter = new DefaultFilter ( new [ ] { "+abc/def" } , true ) ;
123
+ IFilter filter = new DefaultFilter ( [ "+abc/def" ] , true ) ;
124
124
125
125
Assert . True ( filter . IsElementIncludedInReport ( "abc/def" ) , "Element is expected to be included." ) ;
126
126
Assert . True ( filter . IsElementIncludedInReport ( "abc\\ def" ) , "Element is expected to be included." ) ;
@@ -130,7 +130,7 @@ public void LinuxPath_OsIndependantPathSeparator()
130
130
[ Fact ]
131
131
public void WindowsPath_NoOsIndependantPathSeparator ( )
132
132
{
133
- IFilter filter = new DefaultFilter ( new [ ] { "+abc\\ def" } ) ;
133
+ IFilter filter = new DefaultFilter ( [ "+abc\\ def" ] ) ;
134
134
135
135
Assert . False ( filter . IsElementIncludedInReport ( "abc/def" ) , "Element is expected to be excluded." ) ;
136
136
Assert . True ( filter . IsElementIncludedInReport ( "abc\\ def" ) , "Element is expected to be included." ) ;
@@ -140,11 +140,20 @@ public void WindowsPath_NoOsIndependantPathSeparator()
140
140
[ Fact ]
141
141
public void WindowsPath_OsIndependantPathSeparator ( )
142
142
{
143
- IFilter filter = new DefaultFilter ( new [ ] { "+abc/def" } , true ) ;
143
+ IFilter filter = new DefaultFilter ( [ "+abc/def" ] , true ) ;
144
144
145
145
Assert . True ( filter . IsElementIncludedInReport ( "abc/def" ) , "Element is expected to be included." ) ;
146
146
Assert . True ( filter . IsElementIncludedInReport ( "abc\\ def" ) , "Element is expected to be included." ) ;
147
147
Assert . True ( filter . HasCustomFilters ) ;
148
148
}
149
+
150
+ [ Fact ]
151
+ public void WildCardCorreclyEscapedInOsIndependantPathSeparator ( )
152
+ {
153
+ IFilter filter = new DefaultFilter ( [ "-*Class.cs" ] , true ) ;
154
+
155
+ Assert . False ( filter . IsElementIncludedInReport ( "SomeClass.cs" ) , "Element is expected to be excluded." ) ;
156
+ Assert . True ( filter . HasCustomFilters ) ;
157
+ }
149
158
}
150
159
}
0 commit comments