Last active
August 15, 2017 14:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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