Skip to content

Instantly share code, notes, and snippets.

@FransBouma
Last active August 15, 2017 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FransBouma/54245f6062df354a933220e2d15aa80b to your computer and use it in GitHub Desktop.
Save FransBouma/54245f6062df354a933220e2d15aa80b to your computer and use it in GitHub Desktop.
NUnit v3+ Trace output to active test redirect for .NET core and .NET full
[TestFixture]
public class MyTests()
{
[OneTimeSetUp]
public void Init()
{
#if NETCOREAPP2_0
Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
#else
Trace.Listeners.Add(new ConsoleTraceListener());
#endif
}
// your tests
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment