Skip to content

Commit

Permalink
MsTest: Only use TestContext for output and not Console.WriteLine (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
obligaron authored Jan 10, 2025
1 parent 1ab7ee0 commit 3713c14
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Reduced MsBuild log output and consistent use of [Reqnroll] prefix (#381)

## Bug fixes:
* MsTest: Only use TestContext for output and not Console.WriteLine (#368)

* Fix: Replace deprecated dependency `Specflow.Internal.Json` with `System.Text.Json`. The dependency was used for laoding `reqnroll.json`, for Visual Studio integration and for telemetry. (#373)

Expand Down
2 changes: 0 additions & 2 deletions Plugins/Reqnroll.MSTest.ReqnrollPlugin/MSTestTraceListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ public MSTestTraceListener(ITraceListenerQueue traceListenerQueue, IObjectContai
public override void WriteTestOutput(string message)
{
_testContextProvider.GetTestContext().WriteLine(message);
base.WriteTestOutput(message);
}

public override void WriteToolOutput(string message)
{
_testContextProvider.GetTestContext().WriteLine("-> " + message);
base.WriteToolOutput(message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static IEnumerable<TestStepResult> ParseTestOutput(XElement stdOutElemen

var logLines = stdOutText.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);

var primaryOutput = logLines.TakeWhile(line => line != "TestContext Messages:");
var primaryOutput = logLines.Where(line => line != "TestContext Messages:");

TestStepResult step = null;

Expand Down

0 comments on commit 3713c14

Please sign in to comment.