[英]How do you write to the Log tab and Console.Error tab of the NUnit gui runner
在NUnit Gui Runner中,有6个选项卡。 我可以写入Console.Out写一些类似的东西:
Console.WriteLine("This will end up in the Console.Out");
我可以通过写下以下内容来写入Trace选项卡:
System.Diagnostics.Trace.WriteLine("This will end up on the Trace tab");
但是如何写入其他两个选项卡“Log”和“Console.Error”?
要写入Console.Error,请执行以下操作:
Console.Error.WriteLine( “嗒嗒”);
要写入日志,您需要在测试项目中配置log4net,然后在项目的.exe.config文件中设置log4net appender。 使用log4net设置NUnit实际上有点棘手,这里有一个入门指南:
http://www.softwarefrontier.com/2007/09/using-log4net-with-nunit.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.