[英]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.