In the NUnit Gui Runner, there are 6 tabs. I can write to the Console.Out by writing something like:
Console.WriteLine("This will end up in the Console.Out");
I can write to the Trace tab by writing something like:
System.Diagnostics.Trace.WriteLine("This will end up on the Trace tab");
But how do I write to the two other tabs, "Log" and "Console.Error"?
To write to Console.Error, you do this:
Console.Error.WriteLine("blah");
To write to the Log, you need to configure log4net in your test project, then setup a log4net appender in the .exe.config file for your project. NUnit is actually a little tricky to setup with log4net, here's a little guide to get started:
http://www.softwarefrontier.com/2007/09/using-log4net-with-nunit.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With