Skip to content

Commit

Permalink
Fix expected error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Jun 7, 2022
1 parent 99aebed commit 1a4b156
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,16 @@ public void RunTestsShouldThrowOnStackOverflowException(RunnerInfo runnerInfo)
new TestPlatformOptions() { TestCaseFilter = "ExitWithStackoverFlow" },
_runEventHandler);

var errorMessage = $"The active test run was aborted. Reason: Test host process crashed : Process is terminating due to StackOverflowException.{Environment.NewLine}";
var errorMessage = "The active test run was aborted. Reason: Test host process crashed : ";
if (runnerInfo.TargetFramework.StartsWith("netcoreapp2."))
{
errorMessage += "Process is terminating due to StackOverflowException.";
}
else
{
errorMessage += "Process is terminated due to StackOverflowException.";
}
errorMessage += Environment.NewLine;

Assert.IsTrue(_runEventHandler.Errors.Contains(errorMessage));
}
Expand Down

0 comments on commit 1a4b156

Please sign in to comment.