Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit 4a4d5ec

Browse files
Improved sample
1 parent 218d242 commit 4a4d5ec

13 files changed

Lines changed: 23 additions & 17 deletions

File tree

CSharpInteractive.HostApi/BuildMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private static bool TryGetTestState(string? name, out TestState state)
7878
switch(name?.ToLowerInvariant())
7979
{
8080
case "testfinished":
81-
state = TestState.Passed;
81+
state = TestState.Finished;
8282
return true;
8383

8484
case "testignored":

CSharpInteractive.HostApi/TestState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace HostApi;
22

33
public enum TestState
44
{
5-
Passed,
5+
Finished,
66
Failed,
77
Ignored
88
}

CSharpInteractive.Tests/BuildContextTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void ShouldProcessTestFinished()
8888
test.DisplayName.ShouldBe("Test1");
8989
test.FullyQualifiedName.ShouldBe("Full Test1");
9090
test.Duration.ShouldBe(TimeSpan.FromMilliseconds(123));
91-
test.State.ShouldBe(TestState.Passed);
91+
test.State.ShouldBe(TestState.Finished);
9292
test.Message.ShouldBeEmpty();
9393
test.Details.ShouldBeEmpty();
9494
test.Output.ShouldBe(new[]

CSharpInteractive.Tests/BuildResultTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void ShouldSupportToString(string shortName, int? exitCode, int errors, i
2929
.WithTests(
3030
GetTests(TestState.Failed, failedTests)
3131
.Concat(GetTests(TestState.Ignored, ignoredTests))
32-
.Concat(GetTests(TestState.Passed, passedTests))
32+
.Concat(GetTests(TestState.Finished, passedTests))
3333
.ToArray());
3434

3535
// When

CSharpInteractive.Tests/UsageScenarios/DotNetBuildScenario.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void Run()
3636
result = new DotNetTest().WithWorkingDirectory("MyLib").Build();
3737
result.ExitCode.ShouldBe(0);
3838
result.Summary.Tests.ShouldBe(1);
39-
result.Tests.Count(test => test.State == TestState.Passed).ShouldBe(1);
39+
result.Tests.Count(test => test.State == TestState.Finished).ShouldBe(1);
4040
// }
4141
}
4242
}

CSharpInteractive.Tests/UsageScenarios/DotNetMSBuildVSTestScenario.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void Run()
3333
// The "result" variable provides details about a build
3434
result.ExitCode.ShouldBe(0);
3535
result.Summary.Tests.ShouldBe(1);
36-
result.Tests.Count(test => test.State == TestState.Passed).ShouldBe(1);
36+
result.Tests.Count(test => test.State == TestState.Finished).ShouldBe(1);
3737
// }
3838
}
3939
}

CSharpInteractive.Tests/UsageScenarios/DotNetTestScenario.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void Run()
3030
// The "result" variable provides details about a build
3131
result.ExitCode.ShouldBe(0);
3232
result.Summary.Tests.ShouldBe(1);
33-
result.Tests.Count(test => test.State == TestState.Passed).ShouldBe(1);
33+
result.Tests.Count(test => test.State == TestState.Finished).ShouldBe(1);
3434
// }
3535
}
3636
}

CSharpInteractive.Tests/UsageScenarios/DotNetTestWithDotCoverScenario.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void Run()
5454

5555
// The "result" variable provides details about a build
5656
result.ExitCode.ShouldBe(0);
57-
result.Tests.Count(i => i.State == TestState.Passed).ShouldBe(1);
57+
result.Tests.Count(i => i.State == TestState.Finished).ShouldBe(1);
5858

5959
// Generates a HTML code coverage report.
6060
exitCode = new DotNetCustom("dotCover", "report", $"--source={dotCoverSnapshot}", $"--output={dotCoverReport}", "--reportType=HTML").Run();

CSharpInteractive.Tests/UsageScenarios/DotNetVSTestScenario.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void Run()
3838
// The "result" variable provides details about a build
3939
result.ExitCode.ShouldBe(0);
4040
result.Summary.Tests.ShouldBe(1);
41-
result.Tests.Count(test => test.State == TestState.Passed).ShouldBe(1);
41+
result.Tests.Count(test => test.State == TestState.Finished).ShouldBe(1);
4242
// }
4343
}
4444
}

CSharpInteractive/BuildContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private IEnumerable<BuildMessage> OnTestFinished(IServiceMessage message)
8585
}
8686

8787

88-
_tests.Add(BuildMessage.CreateResult(testKey, message, TestState.Passed).WithDuration(duration).WithOutput(ctx.Output));
88+
_tests.Add(BuildMessage.CreateResult(testKey, message, TestState.Finished).WithDuration(duration).WithOutput(ctx.Output));
8989
}
9090

9191
private IEnumerable<BuildMessage> OnTestIgnored(IServiceMessage message)

0 commit comments

Comments
 (0)