# Thursday, October 08, 2009
« SSL with .NET SmtpClient use port 587 fo... | Main | Microsoft Dynamics (Great Plains) SOP101... »
Close up blog entry

I’m using Microsoft Unit Testing to write unit tests in Visual Studio 2008. I wanted to view test output for debugging purposes. I’ll outline how you can view test output.

Use Console.Out.WriteLine to output text from the test.  Then within Visual Studio 2008 you can right click on the test in the test results window and select View Test Results Details.

image

You can also double click the test to view the result details.

A document will display in Visual Studio which will show the console output for the test.

For example the following test:

   [TestMethod]
   public void Testing()
   {
      Console.Out.WriteLine("This is the test output");
   }

Will display this output:

image

There you can see the test output under the Standard Console Output section.

Hopefully this quickly answers this question for someone else :-)

Share/Bookmark
Thursday, October 08, 2009 12:45:39 AM (Eastern Daylight Time, UTC-04:00)  #    Disclaimer  |  Comments [0]  |