xUnit Test Runner无法通过ReSharper运行测试

Oğu*_*kan 8 resharper unit-testing xunit.net .net-core

  • Visual Studio 2015 Enterprise Update 3,将应用所有KB包更新
  • ReSharper 2016.1.2,最新
  • 根据我的project.json文件xunit引用是;
    • "xunit": "2.2.0-beta2-build3300", "xunit.abstractions": "2.0.1-rc2", "xunit.assert": "2.2.0-beta2-build3300", "xunit.extensibility.core": "2.2.0-beta2-build3300", "xunit.extensibility.execution": "2.2.0-beta2-build3300", "xunit.runner.console": "2.2.0-beta2-build3300", "xunit.runner.visualstudio": "2.2.0-beta2-build1149", "xunit.runners": "2.0.0"
  • .Net框架是4.5.2
  • .Net Core Solution类型,表示.xproj

当我尝试使用ReSharper xUnit测试跑步者时,我遇到了;

"单元测试运行器无法运行测试,无法运行xUnit测试 - 找不到文件:"D:\ srcs\GitProjects..etc\bin\My.Tests.dll"参数名称:assemblyFileName

在此输入图像描述 对不起土耳其的异常详情,我无法更改.有什么想法吗?我搜索了很多论坛,我找不到任何有用的东西.提前致谢.

Rub*_*nov 8

Resharper中.NET Core测试的支持计划在2016.3

解决方法是使用Visual Studio Test Explorer.(测试 - > Windows - >测试资源管理器)

project.json文件必须包含xunitdotnet-test-xunit:

{
  ...
  "testRunner": "xunit",
  "dependencies": {
    ...
    "xunit": "2.2.0-beta2-build3300",
    "dotnet-test-xunit": "2.2.0-preview2-build1029",
  },
  ...
}
Run Code Online (Sandbox Code Playgroud)

重建您的项目,您应该能够成功运行您的测试.如果您有Visual Studio 2015,则可以在代码中开始测试.

更新:(2017-02-08)它也适用nunit;

{
  "testRunner": "nunit",
  "dependencies": {
    ...
  "NUnit": "3.5.0",  
  "dotnet-test-nunit": "3.4.0-beta-3"
  },
...
}
Run Code Online (Sandbox Code Playgroud)