NUnit.Analyzers 4.2.0

dotnet add package NUnit.Analyzers --version 4.2.0
NuGet\Install-Package NUnit.Analyzers -Version 4.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NUnit.Analyzers --version 4.2.0
#r "nuget: NUnit.Analyzers, 4.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NUnit.Analyzers as a Cake Addin
#addin nuget:?package=NUnit.Analyzers&version=4.2.0

// Install NUnit.Analyzers as a Cake Tool
#tool nuget:?package=NUnit.Analyzers&version=4.2.0

NUnit Analyzers

Build status GitHub Actions build status NuGet Version and Downloads count MyGet Feed

This is a suite of analyzers that target the NUnit testing framework. Right now, the code is separate from the NUnit framework, so if you want to try out the analyzers you'll need to download the analyzers separately as a nuget package. In the future the analyzers may be added as part of the NUnit framework package but that hasn't been done yet.


The latest stable release of the NUnit Analyzers is available on NuGet or can be downloaded from GitHub. Note that for Visual Studio 2017 one must use versions below 3.0 - note that these versions are no longer updated, so version 2.10.0 is the last version that works in Visual Studio 2017. Version 3.0 and upwards require Visual Studio 2019 (version 16.3) or newer, these versions also enables supression of compiler errors such as errors arising from nullable reference types.

Prerelease nuget packages can be found on MyGet. Please try out the package and report bugs and feature requests.


The full list of analyzers can be found in the documentation.

Below we give two examples of analyzers. One will look for methods with the [TestCase] attribute and makes sure the argument values are correct for the types of the method parameters along with the ExpectedResult value if it is provided.

<img src="" alt="testcase analyzers" width="750"/>

The other analyzer looks for classic model assertions (e.g. Assert.AreEqual(), Assert.IsTrue(), etc.). This analyzer contains a fixer that can translate the classic model assertions into constraint model assertions (Assert.That()).

<img src="" alt="classic model assertions analyzers" width="1000"/>

Which version works with Unity Test Framework

If your Unity project is made by Unity under 2021.2, then use NUnit.Analyzers v2.x.

If your Unity project is made by Unity 2021.2 or later, then use NUnit.Analyzers v3.3 (v3.4 or later of the analyzers does not work with Unity).

You should use an analyzer built with the same version of Microsoft.CodeAnalysis.CSharp as the one embedded in the Unity Editor.


NUnit analyzers are Open Source software and released under the MIT license, which allow the use of the analyzers in free and commercial applications and libraries without restrictions.


There are several ways to contribute to this project. One can try things out, report bugs, propose improvements and new functionality, work on issues (especially the issues marked with the labels help wanted and Good First Issue), and in general join in the conversations. See Contributing for more information.

This project has adopted the Code of Conduct from the Contributor Covenant, version 1.4, available at See the Code of Conduct for more information.


NUnit.Analyzers was created by Jason Bock. A complete list of contributors can be found on the GitHub contributors page.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on NUnit.Analyzers:

Package Downloads
Seeq.Link.SDK.TestFramework The ID prefix of this package has been reserved for one of the owners of this package by

Framework for performing standard tests of Seeq C# connnectors


This library provides you a faster and more reliable way to create your api testing framework using Restsharp


Package Description


Package Description


Package Description

GitHub repositories (129)

Showing the top 5 popular GitHub repositories that depend on NUnit.Analyzers:

Repository Stars
🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
Clean Architecture Solution Template for ASP.NET Core
Distributed Application Framework for .NET
A cross-platform .NET library for IMAP, POP3, and SMTP.
Interactive plotting library for .NET
Version Downloads Last updated
4.2.0 636,666 4/24/2024
4.1.0 897,112 3/16/2024
4.0.1 985,408 2/1/2024
4.0.0 145,242 1/27/2024
3.10.0 1,973,662 11/27/2023
3.10.0-beta1 5,710 11/17/2023
3.9.0 1,317,679 10/27/2023
3.8.0 719,791 9/25/2023
3.7.0 150,272 9/16/2023
3.6.1 7,902,027 3/10/2023
3.6.0 328,762 2/21/2023
3.5.0 3,542,853 10/23/2022
3.3.0 12,933,131 1/8/2022
3.2.0 192,573 8/28/2021
3.1.0 176,689 4/4/2021
3.0.0 96,563 1/18/2021
2.10.0 939 11/27/2023
2.10.0-beta1 121 11/17/2023
2.9.0 689 10/27/2023
2.8.0 809 9/25/2023
2.7.0 802 9/16/2023
2.6.1 3,437 3/10/2023
2.6.0 1,139 2/21/2023
2.5.0 1,470 10/23/2022
2.3.0 1,301 1/8/2022
2.2.0 1,273 8/28/2021
2.1.0 1,927 4/4/2021
2.0.0 1,503 1/18/2021
0.6.0 66,190 11/24/2020
0.5.0 16,179 9/30/2020
0.4.0 17,911 7/25/2020
0.3.0 29,619 5/20/2020
0.2.0 26,878 4/16/2020