[英]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.