![](/img/trans.png)
[英]Resharper Unit Test Runner failed to run tests (System.BadImageFormatException) in release
[英]xUnit Test Runner failed to run tests through ReSharper
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"
当我尝试使用ReSharper xUnit测试跑步者时,我遇到了;
“单元测试运行器无法运行测试,无法运行xUnit测试 - 找不到文件:”D:\\ srcs \\ GitProjects..etc \\ bin \\ My.Tests.dll“参数名称:assemblyFileName
Resharper中对.NET Core测试的支持计划在2016.3
解决方法是使用Visual Studio Test Explorer 。 (测试 - > Windows - >测试资源管理器)
project.json文件必须包含xunit
和dotnet-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.