簡體   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