I am testing an F# project using NUnit. On the debug tab of project configuration I have set the debugger to use an external program which is nunit-console
here and the working directory to the debug folder of my project. I prefer using nunit-console
with the debugger since the GUI version doesn't hit the test file's breakpoints.
When I debug the test the console window appears and disappears and there is no chance to read the output. I have tried Console.Readline()
, but it doesn't work because when I directly run the test from a terminal using nunit-console
, it fails due to this command.
Is there a way to redirect the nunit-console output to the Visuals Studio's output window?
UPDATE: I could use Thread.Sleep()
to delay the nunit-console.exe when I run the test from the console. But from Visual Studio it doesn't happen so I am pretty sure that nunit-console.exe
fails to read the test file when the command is issued by Visual Studio. Still, it would be very nice to be able to read the console output, thus the redirection is still desirable.
Either use Tools->Options...->Debugging->General:"Redirect all Output Window text to Immediate Window" and then make sure that the "Immediate Window" is visible with Debug->Windows->Immediate.
Or use NUnit's "/wait" command line option.