我如何 运行 MSTest V2 在 Visual Studio 2015 中进行测试?

How do I run MSTest V2 tests in Visual Studio 2015?

我从 Visual Studio 2015 年开始尝试 运行 一些使用 MSTest V2 的测试。未正确发现测试:测试资源管理器未显示任何测试,并邀请我构建解决方案,即使我已构建解决方案,或点击“运行 全部”,即使我已经点击它。

我认为该项目可能存在问题,因此我创建了一个新的空测试项目(然后自动发现并正确显示了它的 MSTest V1 测试),删除了对旧 MSTest 程序集的引用,然后添加了 NuGet 包 MSTest.TestFramework 和 MSTest.TestAdapter。该项目(包含一个空的 public 测试,用 [TestMethod] 正确修饰,在具有 [TestClass] 属性的 public class 中)编译正确,但仍然没有测试显示在测试资源管理器中。

输出没有错误window:

------ Discover test started ------

========== Discover test finished: 0 found (0:00:01.7331301) ==========

是否需要采取额外的步骤才能使 MSTest V2 测试在 Visual Studio 2015 年正常运行?

2015 年 Visual Studio 尝试使用 AxoCover instead. I'm seeing the same issue in Visual Studio 2015 where the test projects using MSTest V2 are not discovered by the Test Explorer. Looks like in AxoCover you can pick MSTest v1 or v2, but not both. I haven't seen a similar compatibility issue when using NUnit