NUnit 中不支持的测试框架错误

Unsupported test framework error in NUnit

我正在使用 Visual Studio 2013 的 NUnit 测试。我们正在使用 NUnitTestAdapter 将 NUnit 的测试 运行 与 Visual Studio.

集成

Visual Studio 2013 NUnit 是 version="3.0.1" NUnitTestAdapter 版本="2.0.0" .Net Framework 4.5.2

所有包都是最新的并且是从 Nuget 安装的。没有构建错误。 我们在测试结果中遇到错误 window:

Attempt to load assembly with unsupported test framework in  D:\JuniorAchievement\Git\jaums\JA.UMS.Tests\bin\Debug\JA.UMS.Tests.dll

同时 运行使用 Visual Studio 测试资源管理器宁或调试测试。

测试能够在 Visual Studio 2013 终极版上使用相同代码在一台机器上 运行。我们其他人都有Visual Studio2013专业版,虽然我怀疑跟问题无关

请帮忙。

更新

__________

更新到 NUnit3 测试适配器后没有错误,但仍然没有发现测试。

不知何故,两个适配器都可用,但使用 Nuget 和 VS 扩展我只能找到 NUnit3 测试适配器。

已安装来自 https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d

的 NUnit3 测试适配器

您似乎正在尝试 运行 使用 NUnit2 测试 适配器 进行 NUnit3 测试。这是不支持的。

您需要通过 Tools > Extensions and Updates 在 Visual Studio 中安装 NUnit3 测试 适配器

NUnit 3.x.y (NUnit 3.4.1) 兼容 NUnit3TestAdapter 3.x.y (NUnit3TestAdapter 3.4.0) NUnit 2.x.y (NUnit 2.6.4) 与 NUnitTestAdapter 2.x.y (NUnitTestAdapter 2.0.0)

兼容

如果您使用 NUnit 3.x.y,则必须安装 NUnit3TestAdapter 3.x.y 而不是 NUnitTestAdapter 2.x.y

我正在使用 Microsoft Visual Studio Community 2015 和 Microsoft .NET Framework 4.x

安装步骤:
1. 打开Visual Studio并创建一个项目
2. 右键单击​​项目 -> 从上下文菜单中单击 "Manage Nuget Packages..."
3. 从弹出 window:安装 NUnit 3.x.y 和 NUnit3TestAdapter 3.x.y
4. 现在 运行 你的测试

NUnit 3 只能与 NUnit 测试适配器 3 或最新版本一起运行,因为与旧版本 2.0 存在兼容性问题。 所以如果你有像 this:NUnit VS Adapter 2.0.0.0 发现测试这样的异常 尝试在 c:...... 中加载带有不受支持的测试框架的程序集 NUnit VS Adapter 2.0.0.0 发现测试完成 那么您需要做的就是将最新版本的 NUnit 和 NUnit 测试适配器安装到您的项目中,右键单击解决方案资源管理器上的引用并管理 Nuget 包。

运行 Install-Package NUnit3TestAdapter -Version 3.10.0 在您的程序包管理器控制台上。

运行 这个软件包管理控制台。

PM> 安装包 NUnit3TestAdapter - 版本 3.10.0

确保您已在包源下拉列表中选择 nuget.org 并在默认项目下拉列表中选择测试项目。