How can I view Console Output whilst my Unit Tests are running? I'm using the Visual Studio 2008 unit testing framework. So I know that after a test is finished I can go to the results page for the test and click on output, however I'm after a way that I can effectively watch the console output for tests as the unit tests are executed.
EDIT - Interested in a specific answer for VS out of the box (i.e. without having to buy a plugin)
You can use
System.Diagnostics.Debug.WriteLine("Message");
To output to the "Output" tab while the unit test is running.
If you are using Console.Out.WriteLine("Message") then this will only show up at the end of the test run, as you mentioned.
I have used the following to give me both runtime messages and the end of test result output:
private void TestTrace(string message)
{
System.Diagnostics.Debug.WriteLine(message);
Console.Out.WriteLine(message);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With