Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MsTest: Only use TestContext for output and not Console.WriteLine #368

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Improve parameter type naming for generic types (#343)

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

*Contributors of this release (in alphabetical order):* @clrudolphi, @obligaron, @olegKoshmeliuk

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
Loading