TFS Unit Testing Console Output

  • Thread starter Thread starter not_a_commie
  • Start date Start date
N

not_a_commie

With NUnit and Resharper, you can easily view all Console.Out data.
However, I can't see an easy way to do this with Team Foundation
Server stuff. The TFS unit testing doesn't show any console out data
that I can see. I can use the debug Trace command, but then I only see
that in the output window on a debug run. Any ideas?
 
With NUnit and Resharper, you can easily view all Console.Out data.
However, I can't see an easy way to do this with Team Foundation
Server stuff. The TFS unit testing doesn't show any console out data
that I can see. I can use the debug Trace command, but then I only see
that in the output window on a debug run. Any ideas?

If you use the Trace class (not Debug class), it will work in both
debug and release, and you'll be able to register trace listeners in
app.config that write data where it's convenient (e.g. a log file).

Anyway, why would you want to observe the unit test writing something
to the console every time you run it? It should either just succeed or
just fail, there's no in-between - and when it fails and you want to
know what happened, isn't tracing to output good enough anyway?
 
I've been using unit tests to measure tree search times in addition to
testing the trees. In other words, I only care about the search time
when I'm specifically working on optimizing it. And I only care about
the time in a release compile ran without being attached to a
debugger. It appears that I can use the Assert.Inconclusive command
for my needs. It's not ideal as I have to append all my output into a
single string, but it will work for now.
 
Back
Top