【发布时间】:2017-10-21 00:30:33
【问题描述】:
我已经在我的机器上构建了单元测试 DDL,并在没有安装 Visual Studio 的情况下在另一个地方运行。
为此,我安装了 NUnit 命令行并调用了我的单元测试 DLL,但它不起作用。
在我的 C# 代码中,我只在我的测试方法中添加了 [TestMethod] 属性。
下图显示了我如何在命令行中调用 NUnit:
这里有问题吗,还是有其他方法可以做到这一点?
注意:我在我的项目中使用Selenium 库。
【问题讨论】:
-
Nunit 和 By not console 的版本相同吗?你能从 Visual Studio 运行测试吗?
-
是的,它在 VS 上工作
-
你确定你有 NUnit 单元测试吗?
TestMethod看起来像Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute而不是 NUnit 的... -
@LittleDragon 对 Nunit 使用
[Test]属性而不是[TestMethod]。
标签: c# .net unit-testing nunit nunit-3.0