diff --git a/test/coverlet.core.tests/Coverage/CoverageTests.DoesNotReturn.cs b/test/coverlet.core.tests/Coverage/CoverageTests.DoesNotReturn.cs index d4b371e4d..a0c391d75 100644 --- a/test/coverlet.core.tests/Coverage/CoverageTests.DoesNotReturn.cs +++ b/test/coverlet.core.tests/Coverage/CoverageTests.DoesNotReturn.cs @@ -45,7 +45,7 @@ public void NoBranches_DoesNotReturnAttribute_InstrumentsCorrect() } } - [Fact(Skip = "Hang due to System.Console.ReadKey()")] + [Fact] public void If_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); @@ -68,8 +68,7 @@ public void If_DoesNotReturnAttribute_InstrumentsCorrect() CoverageResult result = TestInstrumentationHelper.GetCoverageResult(path); result.Document("Instrumentation.DoesNotReturn.cs") - .AssertInstrumentLines(BuildConfiguration.Debug, 7, 8, 19, 20, 22, 23, 24, 25, 29, 30) - .AssertNonInstrumentedLines(BuildConfiguration.Debug, 26, 27); + .AssertInstrumentLines(BuildConfiguration.Debug, 7, 8, 19, 20, 22, 23, 24, 25, 29, 30, 26, 27); } finally { @@ -77,7 +76,7 @@ public void If_DoesNotReturnAttribute_InstrumentsCorrect() } } - [Fact(Skip = "Hang due to System.Console.ReadKey()")] + [Fact] public void Switch_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); @@ -100,8 +99,7 @@ public void Switch_DoesNotReturnAttribute_InstrumentsCorrect() CoverageResult result = TestInstrumentationHelper.GetCoverageResult(path); result.Document("Instrumentation.DoesNotReturn.cs") - .AssertInstrumentLines(BuildConfiguration.Debug, 7, 8, 33, 34, 36, 39, 40, 44, 45, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 64, 65, 68, 69) - .AssertNonInstrumentedLines(BuildConfiguration.Debug, 41, 42); + .AssertInstrumentLines(BuildConfiguration.Debug, 7, 8, 33, 34, 36, 39, 40, 44, 45, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 64, 65, 68, 69, 41, 42); } finally { @@ -109,7 +107,7 @@ public void Switch_DoesNotReturnAttribute_InstrumentsCorrect() } } - [Fact(Skip = "Hang due to System.Console.ReadKey()")] + [Fact] public void Subtle_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); @@ -132,8 +130,7 @@ public void Subtle_DoesNotReturnAttribute_InstrumentsCorrect() CoverageResult result = TestInstrumentationHelper.GetCoverageResult(path); result.Document("Instrumentation.DoesNotReturn.cs") - .AssertInstrumentLines(BuildConfiguration.Debug, 7, 8, 72, 73, 75, 78, 82, 83, 86, 87, 91, 92, 95, 101, 102, 103) - .AssertNonInstrumentedLines(BuildConfiguration.Debug, 79, 80, 88, 96, 98, 99); + .AssertInstrumentLines(BuildConfiguration.Debug, 7, 8, 72, 73, 75, 78, 82, 83, 86, 87, 91, 92, 95, 101, 102, 103, 79, 80, 88, 96, 98, 99); } finally { @@ -141,7 +138,7 @@ public void Subtle_DoesNotReturnAttribute_InstrumentsCorrect() } } - [Fact(Skip = "Hang due to System.Console.ReadKey()")] + [Fact] public void UnreachableBranch_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); @@ -164,8 +161,7 @@ public void UnreachableBranch_DoesNotReturnAttribute_InstrumentsCorrect() CoverageResult result = TestInstrumentationHelper.GetCoverageResult(path); result.Document("Instrumentation.DoesNotReturn.cs") - .AssertInstrumentLines(BuildConfiguration.Debug, 7, 8, 106, 107, 108) - .AssertNonInstrumentedLines(BuildConfiguration.Debug, 110, 111, 112, 113, 114); + .AssertInstrumentLines(BuildConfiguration.Debug, 7, 8, 106, 107, 108, 110, 111, 112, 113, 114); } finally { @@ -270,7 +266,7 @@ public void WithLeave_DoesNotReturnAttribute_InstrumentsCorrect() } [Fact] - public void FiltersAndFinallies_DoesNotReturnAttribute_InstrumentsCorrect() + public void FiltersAndFinally_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); try @@ -279,7 +275,7 @@ public void FiltersAndFinallies_DoesNotReturnAttribute_InstrumentsCorrect() { CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper.Run(instance => { - try { instance.FiltersAndFinallies(); } + try { instance.FiltersAndFinally(); } catch (Exception) { } return Task.CompletedTask; diff --git a/test/coverlet.core.tests/Samples/Instrumentation.DoesNotReturn.cs b/test/coverlet.core.tests/Samples/Instrumentation.DoesNotReturn.cs index 2fd37bff7..5c4159214 100644 --- a/test/coverlet.core.tests/Samples/Instrumentation.DoesNotReturn.cs +++ b/test/coverlet.core.tests/Samples/Instrumentation.DoesNotReturn.cs @@ -85,7 +85,7 @@ public void Subtle() case 'C': System.Console.WriteLine("In-Constant-3"); Throws(); - goto alwayUnreachable; // unreachable + goto alwaysUnreachable; // unreachable case 'D': System.Console.WriteLine("In-Constant-4"); @@ -95,7 +95,7 @@ public void Subtle() Throws(); System.Console.WriteLine("Out-Constant-1"); // unreachable - alwayUnreachable: // unreachable + alwaysUnreachable: // unreachable System.Console.WriteLine("Out-Constant-2"); // unreachable subtlyReachable: @@ -167,7 +167,7 @@ public void WithLeave() System.Console.WriteLine("Constant-2"); } - public void FiltersAndFinallies() + public void FiltersAndFinally() { try {