c# - How can I write output from a unit test? - Stack Overflow
stackoverflow.com › questions › 4786884Jun 25, 2020 · Console.WriteLine won't work. Only Debug.WriteLine() or Trace.WriteLine() will work, in debug mode. I do the following: include using System.Diagnostics in the test module. Then, use Debug.WriteLine for my output, right click on the test, and choose Debug Selected Tests. The result output will now appear in the Output window below. I use Visual Studio 2017 version 15.8.1, with the default unit test framework Visual Studio provides.