Return to Snippet

Revision: 29731
at August 4, 2010 03:00 by pckujawa


Initial Code
//Use TestInitialize to run code before running each test
[TestInitialize()]
public void MyTestInitialize()
{
    Trace.Listeners.Add(new ConsoleTraceListener());
}

// Implementation
Trace.WriteLine("Tracing my program execution");

Initial URL

                                

Initial Description
This is particularly useful for unit testing, but you could do it anywhere in your code.

Initial Title
Add the Console as a TraceListener (to have Trace messages treated as Console output)

Initial Tags

                                

Initial Language
C#