NUnit 3.8 VS TestAdapter
This release of the adapter supports .NET Core and .NET Standard projects in Visual Studio 2017.
See the release notes for other changes.
It is recommended to install the adapter from NuGet if you are testing .NET Core or .NET Standard projects. The VSIX adapter does not, and will not, support .NET Core because VSIX packages cannot target multiple platforms.
Adding this adapter and Microsoft.NET.Test.Sdk
version 15.0.0
to your NUnit test projects will also enable the dotnet test
command for .NET Core projects.
Any tests using the new style CSPROJ format, either .NET Core or .NET 4.x, need to add a PackageReference
to the NuGet package Microsoft.NET.Test.Sdk
. Your test assemblies must also be .NET Core, not .NET Standard.
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
</ItemGroup>
.NET Core test can be run on the command line with dotnet test
, for example,
> dotnet test .\test\NetCore10Tests\NetCore10Tests.csproj
Also, note that Code Coverage and Live Unit Testing does not work with .NET Core yet. They will be supported in a future version of Visual Studio, likely post 15.3.