Running NUnit tests in .NET Core with ReSharper

Is it possible to run NUnit tests with R # when these tests are in a .NET Core project? I could not do that. If I choose the option to create the outputs, then R # will not be able to find the NUnit node.

+5
source share
3 answers

Update . The NUnit team and I released full support for .NET Core, a console runner that runs tests on the command line and runs tests in Visual Studio Test Explorer. See NUnit 3 Tests for.NET Core RC2 and ASP.NET Core RC2 for more information.


Neither R #, nor the NUnit Visual Studio adapter, nor even nunit3-console.exe support .NET Core. . NET Core projects currently need to be tested using NUnitLite , creating a spontaneous test build.

The NUnit team is working on a better solution, which we hope will be released in the next few months.

+6
source

December 2016 Update: ReSharper 2016.3 is now available. XUnit and NUnit testers will work with ReSharper> = 2016.3

ReSharper 2016.3 Early Access Program. Now EAP supports running .NET Core Tests from R #, and it's awesome, even it runs tests for each structure.

https://confluence.jetbrains.com/display/ReSharper/ReSharper+2016.3+EAP

enter image description here

Project.json (change according to your use case)

{ "version": "1.0.0-*", "testRunner": "nunit", "runtimes": { "win7-x64": {}, "win8-x64": {}, "win10-x64": {} }, "dependencies": { "NUnit": "3.4.1", "dotnet-test-nunit": "3.4.0-beta-2" }, "frameworks": { "net451": { }, "netcoreapp1.0": { "imports": [ "dotnet5.6", "portable-net45+win8" ] } } } 
+6
source

In vs 2015.3 with Resharper 2017.2 you can create unit test using NUnit for .Net Core 2.

  • Create .Net Core 2 Library.
  • Modify .csproj, add nuget libraies:

      <ItemGroup> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" /> <PackageReference Include="NUnit" Version="3.8.1" /> <PackageReference Include="NUnit3TestAdapter" Version="3.8.0" /> </ItemGroup> 

Read more: Nunit docs: .NET Core and .NET Standard

+2
source

Source: https://habr.com/ru/post/1243650/


All Articles