Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NUnit .NET Core running through ReSharper

I am trying to run NUnit tests for a .NET Core 2.0 project in Visual Studio 2017 through ReSharper. I've had the test .proj assembly set both as console application and class library. So it doesn't seem to be the output type. The solution does not discover any unit test and just displays no results with 0 tests run.

Here is my .csproj file for the tests 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 .NET Core

None of the provided solutions seem to work for me.

like image 479
qubits Avatar asked Nov 23 '17 00:11

qubits


People also ask

Can I use NUnit with .NET core?

The current version of NUnit is 3. It can be installed either from NuGet packages or from . NET Core CLI tool. The following command is used to install NUnit using NuGet packages (Package Manager).

How do I run unit tests with resharper?

Right click on the project or solution in the VS solution-explorer and choose 'Run Unit Tests' Or go to the Resharper menu, choose Unit-Testing and choose one of the options from there.

Does NUnit support .NET framework?

In addition, equivalency tests with large unsortable collections run faster by determining if the collections are sortable before attempting to sort them. We've added several fixes for . NET 6.0 and we've stopped testing NUnit against . NET Core 2.1 which is now out of support.

Is NUnit a test runner?

The nunit.exe program is a graphical runner. It shows the tests in an explorer-like browser window and provides a visual indication of the success or failure of the tests.


1 Answers

I solved by installing the following NuGet packages

  • NUnit
  • NUnit3TestAdapter
  • Microsoft.NET.Test.Sdk
like image 89
DavideGalifi Avatar answered Nov 24 '22 08:11

DavideGalifi