1313using Microsoft . VisualStudio . TestWindow . Extensibility ;
1414using Moq ;
1515using NUnit . Framework ;
16- using FineCodeCoverage . Output ;
1716
1817namespace Test
1918{
20-
2119 internal class TestOperationStateInvocationManager_Tests
2220 {
2321 private AutoMoqer mocker ;
@@ -428,5 +426,42 @@ public void Should_MsCodeCoverageRunSettingsService_TestExecutionNotFinishedAsyn
428426 mockMsCodeCoverageRunSettingsService . Verify ( msCodeCoverageRunSettingsService => msCodeCoverageRunSettingsService . TestExecutionNotFinishedAsync ( mockTestOperation . Object ) ) ;
429427
430428 }
429+
430+ [ Test ]
431+ public void Should_Log_Coverage_Starting_With_Run_Number_When_TestExecutionStartingAsync_And_Coverage_Not_Disabled ( )
432+ {
433+ SetUpOptions ( mockAppOptions =>
434+ {
435+ mockAppOptions . Setup ( o => o . Enabled ) . Returns ( true ) ;
436+ } ) ;
437+
438+ var operation = new Mock < IOperation > ( ) . Object ;
439+ RaiseTestExecutionStarting ( operation ) ;
440+
441+ mocker . Verify < FineCodeCoverage . Output . ILogger > (
442+ logger => logger . Log ( "================================== COVERAGE STARTING - 1 ==================================" ) ) ;
443+
444+ RaiseTestExecutionStarting ( operation ) ;
445+
446+ mocker . Verify < FineCodeCoverage . Output . ILogger > (
447+ logger => logger . Log ( "================================== COVERAGE STARTING - 2 ==================================" ) ) ;
448+ }
449+
450+ [ Test ]
451+ public void Should_Not_Log_Coverage_Starting_When_Coverage_Disabled ( )
452+ {
453+ SetUpOptions ( mockAppOptions =>
454+ {
455+ mockAppOptions . Setup ( o => o . Enabled ) . Returns ( false ) ;
456+ mockAppOptions . Setup ( o => o . DisabledNoCoverage ) . Returns ( true ) ;
457+ } ) ;
458+
459+ var operation = new Mock < IOperation > ( ) . Object ;
460+ RaiseTestExecutionStarting ( operation ) ;
461+
462+ mocker . Verify < FineCodeCoverage . Output . ILogger > (
463+ logger => logger . Log ( "================================== COVERAGE STARTING - 1 ==================================" ) , Times . Never ( ) ) ;
464+
465+ }
431466 }
432467}
0 commit comments