我怎样才能让 NUnit GUI 测试运行器在 Visual Studio 中可用?
How can I get the NUnit GUI test runner to make itself available from Visual Studio?
我将 NUnit (v 3.0.1) 和 NUnit Test Adapter (v 2.0.0) 添加到我的 VS 2013 项目中,然后写了一个 class 应该允许我 运行 a测试:
using NUnit.Framework;
namespace RoboReporter
{
[TestFixture]
public class NUnitTest
{
[Test]
public void Testy()
{
DateTime pseudoRandomDate = new DateTime(2016, 02, 24);
DayOfWeek dow = DayOfWeek.Monday;
DateTime retVal = RoboReporterConstsAndUtils.GetNextWeekday(pseudoRandomDate, dow);
// The value returned should be 2/29/2016
DateTime expectedVal = new DateTime(2016, 02, 29);
Assert.AreEqual(expectedVal, retVal);
}
}
}
...但是我找不到 运行 的 NUnit GUI,正如 here 所说的那样。
我也尝试遵循 this,但无法在任何地方调用甚至找到 NUnit 测试 运行ner。在我的硬盘上搜索 "NUnit.exe" 找不到匹配项。
当我尝试使用“C:\Projects\RoboReporter\RoboReporter\packages\NUnit.3.0.1\lib\net45\nunitframework.dll”作为外部程序启动时,Visual Studio 不会允许它(因为它是一个 .DLL 并且需要一个 .exe,我猜)。
我是否遗漏了一些设置步骤?我什至(在通过 NuGet 安装之后)进入工具 > 扩展和更新并从那里安装了 NUnit 测试适配器,但我仍然看不到任何 NUnit 的迹象(尽管我的项目中有一个 NUnit.3.0.1 文件夹包文件夹)).
更新
我意识到我做错了;我在我的解决方案中添加了一个新项目(一个 class 库),并安装了应该是来自 here. Still, though, I see no such animal. "All Programs" does not have it; this article 的 NUnit GUI Runner 声称它有一个 link,但是 link 不是 "live" 所以我用谷歌搜索 "download NUnit GUI Test Runner" 和 downloaded/installed NUnit.3.0.1.msi,按照 T.S.
的建议
突出显示我的测试项目,选择测试 | Windows |测试资源管理器不显示任何测试。关于如何让 NUnit 可操作,我正在研究[ck,mped]。
更新 2
我发现 this,这看起来很有希望,但我在我的 NuGet 管理器中没有看到 NUnit 的 "downgrade" 选项;安装后,"Uninstall" 是唯一存在的按钮,没有下拉菜单或其他允许降级的控件...
您的软件组合不兼容。
您可以使用运行 NUnit 3.0 测试
- NUnit 3.0 控制台 运行ner
- NUnit 3 测试适配器 CTP 8
请注意,NUnit 3 适配器与您安装的适配器不是同一软件。
对于 运行 3.0 的 NUnit GUI,恐怕您必须等到我们发布它或从我们的源代码构建它。但是它还没有真正准备好用于生产。
要返回 NUnit 2.6.4,卸载 3.0,然后在下拉列表中选择版本重新安装。
我将 NUnit (v 3.0.1) 和 NUnit Test Adapter (v 2.0.0) 添加到我的 VS 2013 项目中,然后写了一个 class 应该允许我 运行 a测试:
using NUnit.Framework;
namespace RoboReporter
{
[TestFixture]
public class NUnitTest
{
[Test]
public void Testy()
{
DateTime pseudoRandomDate = new DateTime(2016, 02, 24);
DayOfWeek dow = DayOfWeek.Monday;
DateTime retVal = RoboReporterConstsAndUtils.GetNextWeekday(pseudoRandomDate, dow);
// The value returned should be 2/29/2016
DateTime expectedVal = new DateTime(2016, 02, 29);
Assert.AreEqual(expectedVal, retVal);
}
}
}
...但是我找不到 运行 的 NUnit GUI,正如 here 所说的那样。
我也尝试遵循 this,但无法在任何地方调用甚至找到 NUnit 测试 运行ner。在我的硬盘上搜索 "NUnit.exe" 找不到匹配项。
当我尝试使用“C:\Projects\RoboReporter\RoboReporter\packages\NUnit.3.0.1\lib\net45\nunitframework.dll”作为外部程序启动时,Visual Studio 不会允许它(因为它是一个 .DLL 并且需要一个 .exe,我猜)。
我是否遗漏了一些设置步骤?我什至(在通过 NuGet 安装之后)进入工具 > 扩展和更新并从那里安装了 NUnit 测试适配器,但我仍然看不到任何 NUnit 的迹象(尽管我的项目中有一个 NUnit.3.0.1 文件夹包文件夹)).
更新
我意识到我做错了;我在我的解决方案中添加了一个新项目(一个 class 库),并安装了应该是来自 here. Still, though, I see no such animal. "All Programs" does not have it; this article 的 NUnit GUI Runner 声称它有一个 link,但是 link 不是 "live" 所以我用谷歌搜索 "download NUnit GUI Test Runner" 和 downloaded/installed NUnit.3.0.1.msi,按照 T.S.
的建议突出显示我的测试项目,选择测试 | Windows |测试资源管理器不显示任何测试。关于如何让 NUnit 可操作,我正在研究[ck,mped]。
更新 2
我发现 this,这看起来很有希望,但我在我的 NuGet 管理器中没有看到 NUnit 的 "downgrade" 选项;安装后,"Uninstall" 是唯一存在的按钮,没有下拉菜单或其他允许降级的控件...
您的软件组合不兼容。
您可以使用运行 NUnit 3.0 测试
- NUnit 3.0 控制台 运行ner
- NUnit 3 测试适配器 CTP 8
请注意,NUnit 3 适配器与您安装的适配器不是同一软件。
对于 运行 3.0 的 NUnit GUI,恐怕您必须等到我们发布它或从我们的源代码构建它。但是它还没有真正准备好用于生产。
要返回 NUnit 2.6.4,卸载 3.0,然后在下拉列表中选择版本重新安装。