views:

15

answers:

2

I like to do console output for exploratory purposes when I am creating a unit test. Is there a way to see the Console.WriteLine("s") in Visual Studio when executing my test using Resharper?

I don't keep the console output in the final version of my tests, so there is no need to comment on that.

+1  A: 

You can use Trace.Write() instead of Console.Write() to write to the output window inside the Visual Studio IDE

See here

Martin Harris
+1  A: 

Sure. When you run the tests in Resharper, the console output appears in the unit testing window, right beneath the test section (i.e. right beneath the section where the tests are listed in the unit testing window). I run Resharper 4.5, so I cannot comment on 5.0 but surely this hasn't changed.

dcp
Thanks for your answer! For my work flow, the Trace.Write() way worked better. I run the test explicitly using the icon to the left of the test method which Resharper creates. I usually debug and want to step and check for output. Having it in the Output window is much more convenient for me. That said, your answer is correct too (strictly maybe more correct), but it isn't as convenient a work flow for me. :-)
Binary255

related questions