NUnit.NET Core Works Through Resharper

I am trying to run NUnit tests for a .NET Core 2.0 project in Visual Studio 2017 through Resharper. I have installed the proj test collector, both a console application and a class library. So this is not like output type. The solution does not detect any unit test and simply does not display the results when running 0 tests.

Here is my csproj project for the project:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <AssemblyName>eCorp.WebStore.OrderService.Tests</AssemblyName>
    <RootNamespace>eCorp.WebStore.OrderService.Tests</RootNamespace>
    <ApplicationIcon />
    <OutputType>Exe</OutputType>
    <StartupObject />
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
    <PackageReference Include="NUnit" Version="3.9.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\..\Core\OrderService.Domain\OrderService.Domain.csproj" />
    <ProjectReference Include="..\..\Core\OrderService.Infrastructure\OrderService.Infrastructure.csproj" />
  </ItemGroup>

</Project>

I found this already: Run NUnit tests in dotnet kernel

None of the solutions provided seem to work for me.

+4
source share
3 answers

I decided to install the following nuget packages - NUNit - NUnit3TestAdapter - Microsoft.NET.Test.Sdk

+2
source

, ReSharper .NET Core 2.0 Visual Studio 2017. ReSharper.

. SO .NET Core 2.0 xUnit

+2

If you installed the packages in the D.GG response and still do not work, check to see if you need to update Resharper. It worked for me.

0
source

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


All Articles