views:

182

answers:

1

I have an odd problem in VS2008 running unit tests. When I run the unit test using either Resharper or TestDriven, in either normal or Debug mode, the Debug.WriteLine("foo") lines are being carried out twice: ie. in the Output window of VS I can see each line written twice.

If I step through the test, however, each line seems to be carried out once as expected. Anyone know what is going on here? Thanks!

+2  A: 

IIRC the Studio's Output window displays not only STDOUT and STDERR but also trace messages. A proper test runner might set up a tracing additionally to writing to STDOUT, something which doesn't happen if you step into the test manually.

David Schmitt
ah! thanks, that's it. Setting the Output window to only show Debug messages rather that Test gives only one "foo" each time.
Joel in Gö