使用NUnit,我需要使用Visual Studio中的哪个项目类型来创建我的测试项目?

时间:2021-01-06 16:38:48

When I am creating a test project in Visual Studio, do I just create a C# console project type, then import Nunit?

当我在Visual Studio中创建测试项目时,我是否只创建一个C#控制台项目类型,然后导入Nunit?

Does the GUI then hook into this project somehow?

那么GUI是否会以某种方式挂钩到这个项目中?

There seems to be tons of nunit related .dll's, which ones do I need?

似乎有很多与nunit相关的.dll,我需要哪些?

2 个解决方案

#1


24  

Just create a class library (i.e. a DLL). You only need to import nunit.framework.dll.

只需创建一个类库(即DLL)。您只需要导入nunit.framework.dll。

Yes, the nUnit GUI loads your assembly (which can be a DLL or a .EXE) and finds all the public classes which have been marked with the appropriate attributes.

是的,nUnit GUI加载程序集(可以是DLL或.EXE)并查找已使用适当属性标记的所有公共类。

#2


1  

I'd recommend checking out the TestDriven.Net Visual Studio plugin. It allows you to run your tests right from VS, so there's no need to fire up the NUnit GUI.

我建议查看TestDriven.Net Visual Studio插件。它允许您直接从VS运行测试,因此无需启动NUnit GUI。

http://www.testdriven.net/

#1


24  

Just create a class library (i.e. a DLL). You only need to import nunit.framework.dll.

只需创建一个类库(即DLL)。您只需要导入nunit.framework.dll。

Yes, the nUnit GUI loads your assembly (which can be a DLL or a .EXE) and finds all the public classes which have been marked with the appropriate attributes.

是的,nUnit GUI加载程序集(可以是DLL或.EXE)并查找已使用适当属性标记的所有公共类。

#2


1  

I'd recommend checking out the TestDriven.Net Visual Studio plugin. It allows you to run your tests right from VS, so there's no need to fire up the NUnit GUI.

我建议查看TestDriven.Net Visual Studio插件。它允许您直接从VS运行测试,因此无需启动NUnit GUI。

http://www.testdriven.net/