visual-studio 是否有适用于 Nunit 的免费 Visual Studio 插件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/247900/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:49:53  来源:igfitidea点击:

Is there a free Visual Studio addin for Nunit?

visual-studiounit-testingnunit

提问by Eric Labashosky

I'm cheap and don't want to pay for ReSharper or TestDriven.NET, is there a free visual Studio addin for NUnit?

我很便宜,不想为 ReSharper 或 TestDriven.NET 付费,是否有适用于 NUnit 的免费 Visual Studio 插件?

回答by Patrick Desjardins

You can create a blank project (Choose console application for example) and in the property of the project you can select DEBUG tag and select "Start External Program". Put the path of Nunit. Then, in the start option, the command line arguments select the DLL that contains all your tests (mine is always in the nunit\bin...). Then select "enable unmanaged code debugging" and you will be able to start the project inside VS and even use the debugger step-by-step.

您可以创建一个空白项目(例如选择控制台应用程序),在项目的属性中,您可以选择 DEBUG 标签并选择“启动外部程序”。放置Nunit的路径。然后,在开始选项中,命令行参数选择包含所有测试的 DLL(我的总是在 nunit\bin...)。然后选择“启用非托管代码调试”,你就可以在 VS 中启动项目,甚至可以一步一步地使用调试器。

This is a free solution.

这是一个免费的解决方案。

回答by ema

Now you can use Gallio: it's open source. www.gallio.org

现在您可以使用 Gallio:它是开源的。www.gallio.org

回答by Patrick Desjardins

By the way TestDrivencan be downloaded for free if it's for personal use or Open Source project.

顺便说一下,如果是供个人使用或开源项目,可以免费下载TestDriven

I had to find a way to use .Net Reflector inside VS few days ago and when I downloaded TestDriven it cames with. Never got any popup asking me to paid.

几天前,我必须找到一种在 VS 中使用.Net Reflector的方法,当我下载 TestDriven 时,它附带了它。从来没有任何弹出窗口要求我付款。

回答by Adam Butler

I know this is an old question but another way to do this is to add an external tool from the tools menu to run nunit - set the arguments to be $(TargetName)$(TargetExt) and initial directory to $(ProjectDir)\bin\Debug

我知道这是一个老问题,但另一种方法是从工具菜单中添加一个外部工具来运行 nunit - 将参数设置为 $(TargetName)$(TargetExt) 并将初始目录设置为 $(ProjectDir)\bin \调试

check out this link

看看这个链接

回答by Cory Foy

NUnit actually ships with a basic integrated runner. It's not very good, and not very publicized, but unless Charlie has taken it out, it should be in the source.

NUnit 实际上附带了一个基本的集成运行器。不是很好,也不是很宣传,但除非查理把它拿出来,否则它应该在源头。

回答by Aliostad

This is an old question and things have changed since the answer was accepted.

这是一个古老的问题,自从答案被接受以来,情况已经发生了变化。



You may try NCrunchto run tests automatically or manually.

您可以尝试使用NCrunch自动或手动运行测试。

回答by Chris S

If you're running Visual Studio 2012, there is a plugin written by Charlie Poole, one of the NUnit contributers, that makes use of the new Visual Studio Unit testing plugins.

如果您运行的是 Visual Studio 2012,则有一个由 NUnit 贡献者之一 Charlie Poole 编写的插件,它利用了新的 Visual Studio 单元测试插件。

Unfortunately it doesn't have much grouping options yet, either by run/not run - so you can't group by class, solution and so on. It also doesn't show you any stacktrace if a test fails, just a simple green tick or red box and a message.

不幸的是,它还没有太多的分组选项,无论是通过运行还是不运行——所以你不能按类、解决方案等进行分组。如果测试失败,它也不会向您显示任何堆栈跟踪,只是一个简单的绿色勾号或红色框和一条消息。

img

图片

回答by Cyryl P?otnicki

Also found this one : http://visualstudiogallery.msdn.microsoft.com/c8164c71-0836-4471-80ce-633383031099
It is able to launch your tests in debugger, however you need to recompile the code manually each time you change something - no auto run-build integration

还发现了这个:http: //visualstudiogallery.msdn.microsoft.com/c8164c71-0836-4471-80ce-633383031099
它能够在调试器中启动您的测试,但是每次更改某些内容时都需要手动重新编译代码 -没有自动运行构建集成

回答by Sujith Gokuladas

I haven't used it, but NUnitit is a free Visual Studio Add-in for NUnit.

我没有使用过它,但 NUnitit 是一个免费的用于 NUnit 的 Visual Studio 插件。

http://nunitit.codeplex.com

http://nunitit.codeplex.com

From my experience, the best add-in for visual studio is resharper. TestDriven.Net is also good for unit tests. Hope that helps

根据我的经验,visual studio 的最佳插件是 resharper。TestDriven.Net 也适用于单元测试。希望有帮助