views:

24

answers:

1

I want to display trace info into Text Output tab in NUnit GUI (ver. 2.5.7, target runtime 4.0):

Trace.Listeners.Add(new ConsoleTraceListener());
Trace.WriteLine("Hello NUnit");

This works fine when I launch NUnit GUI from Visual Studio (2010) via Debug -> Start external application.

But when from .nunit project file and console runner - don't. Why??

A: 

I found not a solution but the reason.

I have MyProject.Test.dll (contains tests itself) and MyProject.dll (the target of tests).

When I use Trace.WriteLine() in MyProject.dll expecting appearance in NUnit it disappoints me and fails.

But when I use Trace.WriteLine() exactly in MyProject.Test.dll - it works. But this makes less sense because I need to trace the target itself to determine the reason of test fail without rewriting.

So will be happy to get know a solution to use trace in target and display it via test.

abatishchev