A.R.
A.R.

Reputation: 15685

Custom messages for unit tests in MSTest

Is there a way that I can customize or otherwise add custom content to the output window? For example, if I have a test case that compares two text files and they don't match, can I somehow place a button in the output window (where the error messages normally appear) that would open the contents of the files in a diff tool?

It seems to me that there should be a way to make this happen, but I can't figure it out...

Upvotes: 0

Views: 456

Answers (2)

Dib
Dib

Reputation: 2083

Using System.Diagnostics.Trace.WriteLine("My Message"); and Console.WriteLine("My Message"); worked well for me. You can then view the output from the test Explorer results window if you need to.

This is the solution presented here: https://stackoverflow.com/a/4589944/254215

Upvotes: 1

allen
allen

Reputation: 4647

There is no inbuilt mechanism to allow you to do this. Like Schaliasos mentions a custom plugin would be the route to go.

Upvotes: 2

Related Questions