Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resharper xUnit tests not working after installing .NET Core 2.0

Right after installing .NET Core SDK 2.0, all tests a solution that targets the previous version of .NET Core fail to be discovered by Resharper.

Also, when I add them manually to the session and attempt to run them, I get an "Inconclusive: Test not run":

enter image description here

Also, there's these exceptions along with the previous message: enter image description here

If I uninstall .NET Core SDK 2.0, everything works as expected. No issues at all. Tried both x86 and x64 versions, same results.

enter image description here

All projects in the solution target .NET Core 1.1.

enter image description here

Running tests from Test Explorer still works just fine.

enter image description here

Any ideas on how to solve this? Could it be a Resharper bug?

like image 709
Daniel Avatar asked Aug 19 '17 19:08

Daniel


People also ask

Does xUnit work with .NET core?

The xUnit.net test runner that we've been using supports . NET Core 1.0 or later, . NET 5.0 or later, and . NET Framework 4.5.

Is xUnit compatible with .NET framework?

I've been using xUnit for quite some time now, and it's my Unit testing framework of choice. It's an open source unit testing tool for . Net framework that's compatible with ReSharper, CodeRush, TestDriven.Net, and Xamarin. You can take advantage of xUnit.Net to assert an exception type easily.

What is xUnit runner Visualstudio?

xunit.runner.visualstudio. This package contains the VSTest runner. This runner is capable of running . NET Framework projects from xUnit.net v1 and v2, and . NET Core and UWP projects projects from xUnit.net v2.


1 Answers

It seems we need to wait for a Resharper update (I've encountered exactly the same error).

Meanwhile, you can run your tests from the Visual Studio runner - it seems to be working fine.

EDIT:

You can also try installing the early version of the Resharper 2017.2 (https://www.jetbrains.com/resharper/eap/) if you feel adventurous ;) I've just checked and it works fine (as of EAP 2017.2 12) with nUnit, xUnit and MSTest tests.

like image 74
Michał Dudak Avatar answered Oct 07 '22 07:10

Michał Dudak