If you use the default settings of Microsoft Visual Studio 2008/2010 UnitTesting, the Console.WriteLine and Debug.WriteLine won’t be shown. By double clicking the test, you can see the test details, including the standard output and debug output, but I wanted to see the messages directly after a run. This can be done by right clicking de gridview in the Test Results window and adding the columns Output (StdOut) and Debug Trace.


UnitTest class

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Scripts
    public class MainUnitTest
        public void TestMethod1()
            string result = string.Empty;

            result = "This is some debug output";

            result = "This is some standard console output";


Add columns




Test Result (showing standard console and debug output)



Details View



  1. And what if I have TestMethod1,TestMethod2 and TestMethod3 ?

    How can I see *all* the console output *concatenated* for all three methods ? Not separately , but together for all three methods.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.