Tuesday, April 16, 2019

Note to Self: How to Use NUnit with C# .Net in Visual Studio for the Mac

I always forget the three libraries to use NUnit with Visual Studio.
Note to self: Download these from NuGet:
  1. NUnit
  2. Microsoft.NET.Test.Sdk
  3. NUnit3TestAdapter

Then select "Run/Run Unit Tests" and VS will create a runner in the bottom pane.


PS: Latest endpoint to connect Visual Studio to the Nuget.org repository is

https://api.nuget.org/v3/index.json

You can put these directly in the csproj:

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
    <PackageReference Include="NUnit" Version="3.11.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
  </ItemGroup>

No comments: