替换NUnit中的Console.WriteLine? [英] replace Console.WriteLine in NUnit?

查看:105
本文介绍了替换NUnit中的Console.WriteLine?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前在NUnit上没有做很多事情,只是想以控制台类型的方式将一些文本转储到窗口中。

haven't done much with NUnit before, but just wanted to dump some text to a window in a console type fashion.

e.g. Console.WriteLine("... some information...");  

当然不会工作,因为NUnit正在驱动事物。

that won't work of course because NUnit is driving things.

我正在构建一些单元测试,并且想要转储变量值列表以在调试期间进行检查。我承认,这并不是严格的单元测试,但这很方便。

I'm in the middle of building some unit tests, and want to dump a list of variable values for inspection during debug. It isn't strictly a unit test if I need to do this I admit that, but it would be convenient.

推荐答案

您可以看到控制台输出,只需在NUnit GUI运行器中选择文本输出选项卡。

You can see Console output, you just have to select the "Text Output" tab in the NUnit GUI runner.

更新

如果使用的是ReSharper测试运行程序,则应显示控制台输出。通过单击测试运行器工具栏中的显示输出按钮,确保显示测试运行器输出窗口:

If you are using the ReSharper test runner, Console output should be displayed. Ensure that the test runner output window is displayed by clicking the "Show Output" button in the test runner tool bar:

然后您应该获得以下信息:

You should then get something as follows:

这篇关于替换NUnit中的Console.WriteLine?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆