How to register test discoverer in .net core using csproj

After updating my nunit testing project using dotnet porting to migrate from json to csproj. I can no longer run my tests. I get a message:

A test detector has not been registered to detect detection of test cases. Register a test opener and try again.

for reference here is my csproj file

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

     <PropertyGroup>
         <OutputType>Exe</OutputType>
         <TargetFramework>netcoreapp1.1</TargetFramework>
     </PropertyGroup>

     <ItemGroup>
         <ProjectReference Include="../Jsonics/Jsonics.csproj" />
     </ItemGroup>

     <ItemGroup>
         <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
         <PackageReference Include="NUnit" Version="3.6.0" />
         <PackageReference Include="dotnet-test-nunit" Version="3.4.0-beta-3" />
     </ItemGroup>
</Project>

On the next page you will learn what to do for xunit and mstest, but not for nunit:

https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json-to-csproj#testrunner

How to register a test detector?

+4
source share
2

, . .

+1

- NUnitLite, exe. , .

+1

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


All Articles