@@ -6,13 +6,41 @@ namespace Coverlet.Core.Reporters.Tests
66 public class ReporterFactoryTests
77 {
88 [ Fact ]
9- public void TestCreateReporter ( )
9+ public void TestCreateReportersWithSingleFormat ( )
1010 {
11- Assert . Equal ( typeof ( JsonReporter ) , new ReporterFactory ( "json" ) . CreateReporter ( ) . GetType ( ) ) ;
12- Assert . Equal ( typeof ( LcovReporter ) , new ReporterFactory ( "lcov" ) . CreateReporter ( ) . GetType ( ) ) ;
13- Assert . Equal ( typeof ( OpenCoverReporter ) , new ReporterFactory ( "opencover" ) . CreateReporter ( ) . GetType ( ) ) ;
14- Assert . Equal ( typeof ( CoberturaReporter ) , new ReporterFactory ( "cobertura" ) . CreateReporter ( ) . GetType ( ) ) ;
15- Assert . Null ( new ReporterFactory ( "" ) . CreateReporter ( ) ) ;
11+ Assert . Collection (
12+ new ReporterFactory ( "json" ) . CreateReporters ( ) ,
13+ reporter => Assert . IsType < JsonReporter > ( reporter ) ) ;
14+ Assert . Collection (
15+ new ReporterFactory ( "lcov" ) . CreateReporters ( ) ,
16+ reporter => Assert . IsType < LcovReporter > ( reporter ) ) ;
17+ Assert . Collection (
18+ new ReporterFactory ( "opencover" ) . CreateReporters ( ) ,
19+ reporter => Assert . IsType < OpenCoverReporter > ( reporter ) ) ;
20+ Assert . Collection (
21+ new ReporterFactory ( "cobertura" ) . CreateReporters ( ) ,
22+ reporter => Assert . IsType < CoberturaReporter > ( reporter ) ) ;
23+ Assert . Empty ( new ReporterFactory ( "" ) . CreateReporters ( ) ) ;
24+ }
25+
26+ [ Fact ]
27+ public void TestCreateReportersWithMultipleFormats ( )
28+ {
29+ Assert . Collection (
30+ new ReporterFactory ( "json,lcov" ) . CreateReporters ( ) ,
31+ reporter => Assert . IsType < JsonReporter > ( reporter ) ,
32+ reporter => Assert . IsType < LcovReporter > ( reporter ) ) ;
33+ Assert . Collection (
34+ new ReporterFactory ( "json,lcov,opencover" ) . CreateReporters ( ) ,
35+ reporter => Assert . IsType < JsonReporter > ( reporter ) ,
36+ reporter => Assert . IsType < LcovReporter > ( reporter ) ,
37+ reporter => Assert . IsType < OpenCoverReporter > ( reporter ) ) ;
38+ Assert . Collection (
39+ new ReporterFactory ( "json,lcov,opencover,cobertura" ) . CreateReporters ( ) ,
40+ reporter => Assert . IsType < JsonReporter > ( reporter ) ,
41+ reporter => Assert . IsType < LcovReporter > ( reporter ) ,
42+ reporter => Assert . IsType < OpenCoverReporter > ( reporter ) ,
43+ reporter => Assert . IsType < CoberturaReporter > ( reporter ) ) ;
1644 }
1745 }
1846}
0 commit comments