Kevin Driedger
Kevin Driedger

Reputation: 54312

How do I add an output file to the result window using mstest?

My test has a file as output. I would like to see that file in the output window for my test (i.e. if I right click on a completed test and select: View Test Results Details).

Upvotes: 3

Views: 1740

Answers (1)

Kevin Driedger
Kevin Driedger

Reputation: 54312

Make sure your TestClass has a property called TestContext of type TestContext then inside your test you can add the line:

TestContext.AddResultFile(fullyQualifiedName);

where the fullyQualifiedName is a string of the path to your file.

Upvotes: 6

Related Questions