Thursday, July 14, 2016

NUnit 3: Trace.WriteLine not captured in Test Explorer

After upgrading to NUnit 3, I noticed that no Tracing information was captured and written to the Test Output. (Note: I didn’t verify but I’m quiet sure it worked when using NUnit 2.x)

After searching through the documentation and Issues list on GitHub, I found the following quote:

“Currently, the "channels" we capture are Console.Out, Console.Error and TestContext.Out. ”

So indeed no Trace.Write(Line) in the list. Let’s check if this statement is correct…

Here is my test code:


And let’s now have a look at the test results:

  • Trace.WriteLine – no output available Sad smile:


  • TestContext.WriteLine – with output Winking smile:



No comments: