79178530

Date: 2024-11-11 17:11:00
Score: 0.5
Natty:
Report link

These are good answers, but I would also suggest checking the NUnit documentation, since the setup might change over time: https://docs.nunit.org/articles/nunit/technical-notes/usage/Trace-and-Debug-Output.html

Today, when I was looking at the same problem in VS 2022, I got it working by

a) Adding the code in the 2nd example from the page page referenced:

    [OneTimeSetUp]
    public void StartTest()
    {
        if (!Trace.Listeners.OfType<ProgressTraceListener>().Any())
            Trace.Listeners.Add(new ProgressTraceListener());
    }

b) Change the output in from "Debug" to "Tests" in Visual Studio:

Screen clipping of Visual Studio output drop-down.

c) Then I was able to see the Console.WriteLine("Whatever!") output that's inside my test.

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Papa Stahl