8
votes
  • Visual Studio 2015 Enterprise Update 3, all KB package updates are applied
  • ReSharper 2016.1.2, latest
  • According to my project.json file xunit references are;
    • "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 framework is 4.5.2
  • .Net Core Solution type which means .xproj

When i try to use ReSharper xUnit test runner, i'm encountering;

"Unit Test Runner failed to run tests, Unable to run xUnit tests - File not found:"D:\srcs\GitProjects..etc\bin\My.Tests.dll" Parameter name: assemblyFileName

enter image description here Sorry for Turkish exception details, i couldn't change yet. Any idea about that? I searched a lot of forums and i couldn't find any useful stuff. Thanks in advance.

3
I have the same problem. Haven't found a fix yet. If you check the path you'll see that Debug or Release is missing so the dll cannot be found. Also when you say package.json I think you mean project.json. If that is the case, then you are working in a .net core solution. (as am I) probably best to mention that in your question.Rubanov
@Rubanov, thanks for the comments, i edited the question. Yes xUnit runner need the path that should located under directly debug or release. I don't know, which tool is responsible for that, visual studio or xunit runner or resharper...Oğuzhan Soykan
It's resharper. I am now using the Visual Studio Test Explorer. Make sure you have this in your project.json: "testRunner": "xunit", and "dependencies": { "xunit": "2.2.0-beta2-build3300", "dotnet-test-xunit": "2.2.0-preview2-build1029" }, After a build you should be able to test in Test ExplorerRubanov
@Rubanov thanks for the tips. I applied what exactly that you said. And using now visual studio test explorer i can debug and run all tests. Resharper has to fix this.Oğuzhan Soykan
You can download the Resharper EAP (early access program) of 2016.3 to start using it now. It is pre-release, but it's very stable. I've been using it with no problem so far. confluence.jetbrains.com/display/ReSharper/ReSharper+2016.3+EAPcygnim

3 Answers

8
votes

Support for .NET Core testing in Resharper is scheduled for 2016.3

The workaround is to use Visual Studio Test Explorer. (Test --> Windows --> Test Explorer)

The project.json file must contain xunit and dotnet-test-xunit:

{
  ...
  "testRunner": "xunit",
  "dependencies": {
    ...
    "xunit": "2.2.0-beta2-build3300",
    "dotnet-test-xunit": "2.2.0-preview2-build1029",
  },
  ...
}

Rebuild your project and you should be able to successfully run your tests. If you have Visual Studio 2015 you can start your test inside the code.

Update: (2017-02-08) It also works with nunit;

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

ReSharper doesn't currently support .net core testing. This is scheduled for 2016.3.

-1
votes

By installing the Early Access Program(2016.3) of Resharper, you will be able to run your dotnet core tests.
It supports both nunit and xunit. I installed it, and it solved the issue for me.

Link to the relase details:
https://blog.jetbrains.com/dotnet/2016/09/26/resharper-ultimate-2016-3-eap-build-1-details/