繁体   English   中英

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

[英]xUnit Test Runner failed to run tests through ReSharper

  • 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

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

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",
  },
  ...
}

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

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

{
  "testRunner": "nunit",
  "dependencies": {
    ...
  "NUnit": "3.5.0",  
  "dotnet-test-nunit": "3.4.0-beta-3"
  },
...
}

ReSharper目前不支持.net核心测试。 这是预定2016.3。

通过安装Resharper的Early Access Program(2016.3),您将能够运行您的dotnet核心测试。
它支持nunit和xunit。 我安装了它,它解决了我的问题。

链接到相关细节:
https://blog.jetbrains.com/dotnet/2016/09/26/resharper-ultimate-2016-3-eap-build-1-details/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM