@@ -192,6 +192,67 @@ public void Should_Not_Filter_Issues_With_Existing_File()
192
192
// Then
193
193
fixture . Log . Entries . ShouldContain ( x => x . Message == "0 issue(s) were filtered because they either don't belong to a file or the file does not exist." ) ;
194
194
}
195
+
196
+ [ Fact ]
197
+ public void Should_Work_Without_Priority ( )
198
+ {
199
+ // Given
200
+ using var tempSourceFile = new TemporarySourceFile ( "Testfiles.TestFile.txt" ) ;
201
+ var filePath = tempSourceFile . FilePath ;
202
+ output . WriteLine ( $ "File path: { filePath } ") ;
203
+ var directory = Path . GetDirectoryName ( filePath ) ! ;
204
+ var fileName = Path . GetFileName ( filePath ) ;
205
+ var fixture = new ConsoleIssueReportFixture
206
+ {
207
+ ConsoleIssueReportFormatSettings =
208
+ {
209
+ ShowDiagnostics = true
210
+ }
211
+ } ;
212
+ var issues =
213
+ new List < IIssue >
214
+ {
215
+ IssueBuilder
216
+ . NewIssue ( "Message Foo" , "ProviderType Foo" , "ProviderName Foo" )
217
+ . InFile ( fileName , 1 , 1 )
218
+ . Create ( ) ,
219
+ } ;
220
+ // When
221
+ _ = fixture . CreateReport ( issues , directory ) ;
222
+
223
+ // Then
224
+ }
225
+
226
+ [ Fact ]
227
+ public void Should_Work_With_Priority ( )
228
+ {
229
+ // Given
230
+ using var tempSourceFile = new TemporarySourceFile ( "Testfiles.TestFile.txt" ) ;
231
+ var filePath = tempSourceFile . FilePath ;
232
+ output . WriteLine ( $ "File path: { filePath } ") ;
233
+ var directory = Path . GetDirectoryName ( filePath ) ! ;
234
+ var fileName = Path . GetFileName ( filePath ) ;
235
+ var fixture = new ConsoleIssueReportFixture
236
+ {
237
+ ConsoleIssueReportFormatSettings =
238
+ {
239
+ ShowDiagnostics = true
240
+ }
241
+ } ;
242
+ var issues =
243
+ new List < IIssue >
244
+ {
245
+ IssueBuilder
246
+ . NewIssue ( "Message Foo" , "ProviderType Foo" , "ProviderName Foo" )
247
+ . InFile ( fileName , 1 , 1 )
248
+ . WithPriority ( IssuePriority . Error )
249
+ . Create ( ) ,
250
+ } ;
251
+ // When
252
+ _ = fixture . CreateReport ( issues , directory ) ;
253
+
254
+ // Then
255
+ }
195
256
}
196
257
}
197
258
}
0 commit comments