11using NUnit . Framework ;
22using System . Linq ;
33using TestStack . BDDfy . Configuration ;
4- using TestStack . BDDfy . Processors ;
54using TestStack . BDDfy . Reporters . Html ;
5+ using TestStack . BDDfy . Reporters . HtmlMetro ;
66using TestStack . BDDfy . Reporters . MarkDown ;
77
88namespace TestStack . BDDfy . Tests . Configuration
99{
1010 [ TestFixture ]
1111 public class BatchProcessorsTests
1212 {
13+ static bool MetroReportProcessorIsActive ( IBatchProcessor batchProcessor )
14+ {
15+ return batchProcessor is HtmlReporter && ( ( HtmlReporter ) batchProcessor ) . ReportBuilder is HtmlMetroReportBuilder ;
16+ }
17+
1318 [ Test ]
1419 public void ReturnsHtmlReporterByDefault ( )
1520 {
@@ -24,24 +29,44 @@ public void DoesNotReturnMarkDownReporterByDefault()
2429 Assert . IsFalse ( processors . Any ( p => p is MarkDownReporter ) ) ;
2530 }
2631
32+ [ Test ]
33+ public void DoesNotReturnHtmlMetroReporterByDefault ( )
34+ {
35+ var processors = Configurator . BatchProcessors . GetProcessors ( ) . ToList ( ) ;
36+ Assert . IsFalse ( processors . Any ( MetroReportProcessorIsActive ) ) ;
37+ }
38+
2739 [ Test ]
2840 public void DoesNotReturnHtmlReporterWhenItIsDeactivated ( )
2941 {
3042 Configurator . BatchProcessors . HtmlReport . Disable ( ) ;
43+
3144 var processors = Configurator . BatchProcessors . GetProcessors ( ) . ToList ( ) ;
32-
3345 Assert . IsFalse ( processors . Any ( p => p is HtmlReporter ) ) ;
46+
3447 Configurator . BatchProcessors . HtmlReport . Enable ( ) ;
3548 }
3649
3750 [ Test ]
3851 public void ReturnsMarkdownReporterWhenItIsActivated ( )
3952 {
4053 Configurator . BatchProcessors . MarkDownReport . Enable ( ) ;
54+
4155 var processors = Configurator . BatchProcessors . GetProcessors ( ) . ToList ( ) ;
42-
4356 Assert . IsTrue ( processors . Any ( p => p is MarkDownReporter ) ) ;
57+
4458 Configurator . BatchProcessors . MarkDownReport . Disable ( ) ;
4559 }
60+
61+ [ Test ]
62+ public void ReturnsHtmlMetroReporterWhenItIsActivated ( )
63+ {
64+ Configurator . BatchProcessors . HtmlMetroReport . Enable ( ) ;
65+
66+ var processors = Configurator . BatchProcessors . GetProcessors ( ) . ToList ( ) ;
67+ Assert . IsTrue ( processors . Any ( MetroReportProcessorIsActive ) , "The metro Html report was not found in batch processors" ) ;
68+
69+ Configurator . BatchProcessors . HtmlMetroReport . Disable ( ) ;
70+ }
4671 }
4772}
0 commit comments