Tuesday 3 May 2011

Dot.Net: Unit Test VS2010 Write Output

Question:
How to write to console / output from a UnitTests method in Visual Studio 2010 ?


Answer:
You simply have to know that you should use the TestContext, a utility class of the Visual Studio test framework.


Here is an example
[TestMethod()]
public void ProcessTest()
{
    TestContext.WriteLine("Hello Test");
}


No comments: