@@ -27,23 +27,23 @@ public void Setup()
27
27
[ TestCaseSource ( nameof ( InvalidColumnNames ) ) ]
28
28
public void Given_ColumNameIsNotValidProperty_Should_ReturnFilterWithIsValidEqualsFalse ( string propertyName )
29
29
{
30
- var result = FilterFactory < TestPoco > . Create ( propertyName , string . Empty , MockLogger . Object ) ;
30
+ var result = FilterFactory < TestPoco > . Create ( propertyName , string . Empty , Logger ) ;
31
31
32
32
Assert . That ( result . IsValid , Is . EqualTo ( false ) ) ;
33
33
}
34
34
35
35
[ TestCaseSource ( nameof ( InvalidColumnNames ) ) ]
36
36
public void Given_ColumNameIsNotValidProperty_Should_ReturnFilterWithErrorMessageValue ( string propertyName )
37
37
{
38
- var result = FilterFactory < TestPoco > . Create ( propertyName , string . Empty , MockLogger . Object ) ;
38
+ var result = FilterFactory < TestPoco > . Create ( propertyName , string . Empty , Logger ) ;
39
39
40
40
Assert . That ( result . ErrorMessage , Is . Not . Null ) ;
41
41
}
42
42
43
43
[ TestCaseSource ( nameof ( InvalidColumnNames ) ) ]
44
44
public void Given_ColumNameIsNotValidProperty_Should_LogWarningOnce ( string propertyName )
45
45
{
46
- var result = FilterFactory < TestPoco > . Create ( propertyName , string . Empty , MockLogger . Object ) ;
46
+ var result = FilterFactory < TestPoco > . Create ( propertyName , string . Empty , Logger ) ;
47
47
48
48
MockLogger . VerifyLogging ( LogLevel . Warning , Times . Once ( ) ) ;
49
49
}
@@ -57,23 +57,23 @@ public void Given_ColumNameIsNotValidProperty_Should_LogWarningOnce(string prope
57
57
[ TestCaseSource ( nameof ( InvalidOperators ) ) ]
58
58
public void Given_OperatorIsNotValid_Should_ReturnFilterWithIsValidEqualsFalse ( string filter )
59
59
{
60
- var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , filter , MockLogger . Object ) ;
60
+ var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , filter , Logger ) ;
61
61
62
62
Assert . That ( result . IsValid , Is . EqualTo ( false ) ) ;
63
63
}
64
64
65
65
[ TestCaseSource ( nameof ( InvalidOperators ) ) ]
66
66
public void Given_OperatorIsNotValid_Should_ReturnFilterWithErrorMessageValue ( string filter )
67
67
{
68
- var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , filter , MockLogger . Object ) ;
68
+ var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , filter , Logger ) ;
69
69
70
70
Assert . That ( result . ErrorMessage , Is . Not . Null ) ;
71
71
}
72
72
73
73
[ TestCaseSource ( nameof ( InvalidOperators ) ) ]
74
74
public void Given_OperatorIsNotValid_Should_LogWarningOnce ( string filter )
75
75
{
76
- var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , filter , MockLogger . Object ) ;
76
+ var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , filter , Logger ) ;
77
77
78
78
MockLogger . VerifyLogging ( LogLevel . Warning , Times . Once ( ) ) ;
79
79
}
@@ -97,23 +97,23 @@ public void Given_OperatorIsNotValid_Should_LogWarningOnce(string filter)
97
97
[ TestCaseSource ( nameof ( ValidNonStringColumnTypes ) ) ]
98
98
public void Given_ValueDoesNotCastToNamedColumnType_Should_ReturnFilterWithIsValidEqualsFalse ( string propertyName )
99
99
{
100
- var result = FilterFactory < TestPoco > . Create ( propertyName , ValueDoesNotCastToNamedColumnTypeValue , MockLogger . Object ) ;
100
+ var result = FilterFactory < TestPoco > . Create ( propertyName , ValueDoesNotCastToNamedColumnTypeValue , Logger ) ;
101
101
102
102
Assert . That ( result . IsValid , Is . EqualTo ( false ) ) ;
103
103
}
104
104
105
105
[ TestCaseSource ( nameof ( InvalidOperators ) ) ]
106
106
public void Given_ValueDoesNotCastToNamedColumnType_Should_ReturnFilterWithErrorMessageValue ( string propertyName )
107
107
{
108
- var result = FilterFactory < TestPoco > . Create ( propertyName , ValueDoesNotCastToNamedColumnTypeValue , MockLogger . Object ) ;
108
+ var result = FilterFactory < TestPoco > . Create ( propertyName , ValueDoesNotCastToNamedColumnTypeValue , Logger ) ;
109
109
110
110
Assert . That ( result . ErrorMessage , Is . Not . Null ) ;
111
111
}
112
112
113
113
[ TestCaseSource ( nameof ( InvalidOperators ) ) ]
114
114
public void Given_ValueDoesNotCastToNamedColumnType_Should_LogWarningOnce ( string propertyName )
115
115
{
116
- var result = FilterFactory < TestPoco > . Create ( propertyName , ValueDoesNotCastToNamedColumnTypeValue , MockLogger . Object ) ;
116
+ var result = FilterFactory < TestPoco > . Create ( propertyName , ValueDoesNotCastToNamedColumnTypeValue , Logger ) ;
117
117
118
118
MockLogger . VerifyLogging ( LogLevel . Warning , Times . Once ( ) ) ;
119
119
}
@@ -140,7 +140,7 @@ public void Given_ValidColumnNameAndFilter_Should_ReturnFilterWithIsValidEqualsT
140
140
[ ValueSource ( nameof ( SimpleFilterTypes ) ) ] string filter
141
141
)
142
142
{
143
- var result = FilterFactory < TestPoco > . Create ( propertyName . Key , $ "{ filter } :{ propertyName . Value } ", MockLogger . Object ) ;
143
+ var result = FilterFactory < TestPoco > . Create ( propertyName . Key , $ "{ filter } :{ propertyName . Value } ", Logger ) ;
144
144
145
145
Assert . That ( result . IsValid , Is . EqualTo ( true ) ) ;
146
146
}
@@ -151,7 +151,7 @@ public void Given_ValidColumnNameAndFilter_Should_ReturnFilterErrorMessageIsNull
151
151
[ ValueSource ( nameof ( SimpleFilterTypes ) ) ] string filter
152
152
)
153
153
{
154
- var result = FilterFactory < TestPoco > . Create ( propertyName . Key , $ "{ filter } :{ propertyName . Value } ", MockLogger . Object ) ;
154
+ var result = FilterFactory < TestPoco > . Create ( propertyName . Key , $ "{ filter } :{ propertyName . Value } ", Logger ) ;
155
155
156
156
Assert . That ( result . ErrorMessage , Is . Null ) ;
157
157
}
@@ -162,7 +162,7 @@ public void Given_ValidColumnNameAndFilter_Should_LogZeroWarnings(
162
162
[ ValueSource ( nameof ( SimpleFilterTypes ) ) ] string filter
163
163
)
164
164
{
165
- var result = FilterFactory < TestPoco > . Create ( propertyName . Key , $ "{ filter } :{ propertyName . Value } ", MockLogger . Object ) ;
165
+ var result = FilterFactory < TestPoco > . Create ( propertyName . Key , $ "{ filter } :{ propertyName . Value } ", Logger ) ;
166
166
167
167
MockLogger . VerifyLogging ( LogLevel . Warning , Times . Never ( ) ) ;
168
168
}
@@ -173,47 +173,47 @@ public void Given_ValidColumnNameAndFilter_Should_LogZeroWarnings(
173
173
[ Test ]
174
174
public void Given_LikeFilterWithStringColumn_Should_ReturnFilterWithIsValidEqualsTrue ( )
175
175
{
176
- var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , $ "like:hello*", MockLogger . Object ) ;
176
+ var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , $ "like:hello*", Logger ) ;
177
177
178
178
Assert . That ( result . IsValid , Is . EqualTo ( true ) ) ;
179
179
}
180
180
181
181
[ Test ]
182
182
public void Given_LikeFilterWithStringColumn_Should_ReturnFilterErrorMessageIsNull ( )
183
183
{
184
- var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , $ "like:hello*", MockLogger . Object ) ;
184
+ var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , $ "like:hello*", Logger ) ;
185
185
186
186
Assert . That ( result . ErrorMessage , Is . Null ) ;
187
187
}
188
188
189
189
[ Test ]
190
190
public void Given_LikeFilterWithStringColumn_Should_LogZeroWarnings ( )
191
191
{
192
- var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , $ "like:hello*", MockLogger . Object ) ;
192
+ var result = FilterFactory < TestPoco > . Create ( nameof ( TestPoco . StringProp ) , $ "like:hello*", Logger ) ;
193
193
194
194
MockLogger . VerifyLogging ( LogLevel . Warning , Times . Never ( ) ) ;
195
195
}
196
196
197
197
[ TestCaseSource ( nameof ( ValidNonStringColumnTypes ) ) ]
198
198
public void Given_LikeFilterWithNonStringColumn_Should_ReturnFilterWithIsValidEqualsFalse ( string propertyName )
199
199
{
200
- var result = FilterFactory < TestPoco > . Create ( propertyName , $ "like:hello*", MockLogger . Object ) ;
200
+ var result = FilterFactory < TestPoco > . Create ( propertyName , $ "like:hello*", Logger ) ;
201
201
202
202
Assert . That ( result . IsValid , Is . EqualTo ( false ) ) ;
203
203
}
204
204
205
205
[ TestCaseSource ( nameof ( ValidNonStringColumnTypes ) ) ]
206
206
public void Given_LikeFilterWithNonStringColumn_Should_ReturnFilterWithErrorMessageValue ( string propertyName )
207
207
{
208
- var result = FilterFactory < TestPoco > . Create ( propertyName , $ "like:hello*", MockLogger . Object ) ;
208
+ var result = FilterFactory < TestPoco > . Create ( propertyName , $ "like:hello*", Logger ) ;
209
209
210
210
Assert . That ( result . ErrorMessage , Is . Not . Null ) ;
211
211
}
212
212
213
213
[ TestCaseSource ( nameof ( ValidNonStringColumnTypes ) ) ]
214
214
public void Given_LikeFilterWithNonStringColumn_Should_LogWarningOnce ( string propertyName )
215
215
{
216
- var result = FilterFactory < TestPoco > . Create ( propertyName , $ "like:hello*", MockLogger . Object ) ;
216
+ var result = FilterFactory < TestPoco > . Create ( propertyName , $ "like:hello*", Logger ) ;
217
217
218
218
MockLogger . VerifyLogging ( LogLevel . Warning , Times . Once ( ) ) ;
219
219
}
0 commit comments