Redirecting "nunit-console" output to the Visual Studio output window

I am testing an F # project using NUnit . On the debug tab of the project configuration, I installed a debugger to use the external program that is nunit-consolehere, and the working directory in the debug folder of my project. I prefer to use it nunit-consolewith a debugger, since the version of the GUI does not fall into the control points of the test file.

When I debug the test, the console window appears and disappears, and there is no way to read the result. I tried Console.Readline(), but this will not work, because when I directly run the test from the terminal using nunit-console, it does not work because of this command.

Is there a way to redirect nunit-console output to a Visual Studio output window?

UPDATE: I could use Thread.Sleep()nunit-console.exe to delay when starting a test from the console. But this does not happen from Visual Studio, so I'm sure that nunit-console.exeI will not be able to read the test file when the command is issued by Visual Studio. However, it would be very nice to be able to read console output, so redirection is still desirable.

+3
source share
2 answers

Use Tools-> Options ...-> Debugging-> General: "Redirect all the text of the output window to the" Immediate window "window , and then make sure that the" Immediate window "is displayed using Debug -.> Windows-> Immediate

NUnit /wait.

+1

- , , nunit.exe DLL . Visual Studio, .

0

Source: https://habr.com/ru/post/1794419/


All Articles