我一直在想:
The type or namespace name 'TestSuite' could not be found (are you missing a using directive or an assembly reference?)我使用的是visual studio 2010,我已经通过NuGet安装了最新的NUnit和selenium参考资料。代码如下:
using NUnit.Framework;
namespace SeleniumTests
{
public class ManifestTestSuite
{
[Suite]
public static TestSuite Suite
{
get
{
TestSuite suite = new TestSuite("MyTestSuite");
suite.Add(new AddAll());
suite.Add(new RemoveAll());
return suite;
}
}
}
}发布于 2013-03-23 03:52:17
TestSuite类位于nunit.core.dll中,它不随nuget包一起分发,因为通常不需要它。
因此,您需要从the NUnit website下载“完整的”nunit包,您可以在压缩文件内的nunit.core.dll文件夹中找到nunit。
但是,您不需要这样做,因为从2.4.4开始有一种新方法,如documenation中所述:您可以返回测试数组,而不是实例TestSuite
[Suite]
public static IEnumerable Suite
{
get
{
ArrayList suite = new ArrayList();
suite.Add(new AddAll());
suite.Add(new RemoveAll());
return suite;
}
}https://stackoverflow.com/questions/15578288
复制相似问题