xUnit.net is a developer testing framework, built to support Test Driven Development, with a design goal of extreme simplicity and alignment with framework features. Installing this package provides code analyzers to help developers find and fix frequent issues when writing tests and xUnit.net extensibility code.
$ dotnet add package xunit.analyzersThis project contains source code analysis and cleanup rules for xUnit.net. Analysis and fixes are only supported with C#.
Requirements: xUnit.net v2 or v3. Supported in Visual Studio 2019 16.11+ or 2022 17.4+ (as well as via command line builds with Roslyn 3.11+). Other environments (such as Mono or JetBrains Rider) may be able to use these analyzers as well; support and issue resolution will be provided by those third parties and not by xUnit.net itself.
Documentation: a list of supported rules is available at https://xunit.net/xunit.analyzers/rules/
Bugs and issues: please visit the core xUnit.net project issue tracker.
Building: see BUILDING.md.
xUnit.net v3: the analyzer package is referenced by the main xunit.v3 NuGet package out of the box.
If you choose to reference xunit.v3.core instead, you can reference
xunit.analyzers explicitly.
xUnit.net v2 2.3.0 and higher: the analyzer package is referenced by the main xunit NuGet package out of the box.
If you choose to reference xunit.core instead, you can reference
xunit.analyzers explicitly.
xUnit.net v2 2.2.0 and earlier: you have to install the xunit.analyzers NuGet package explicitly.
If you are using xUnit.net v3 and do not wish to use the analyzers package, replace the package reference
to xunit.v3 with the corresponding versions of xunit.v3.core
and xunit.v3.assert.
If you are using xUnit.net v2 2.3.0 or higher and do not wish to use the analyzers package, replace the package reference
to xunit with the corresponding versions of
and .
If you are using xUnit.net v2 v2.2.0 or earlier: remove the reference to the xunit.analyzers NuGet package.

xUnit.net is a free, open source, community-focused unit testing tool for C#, F#, and Visual Basic.
xUnit.net works with the .NET SDK command line tools, Visual Studio, Visual Studio Code, JetBrains Rider, NCrunch, and any development environment compatible with Microsoft Testing Platform (xUnit.net v3) or VSTest (all versions of xUnit.net).
xUnit.net is part of the .NET Foundation and operates under their code of conduct. It is licensed under Apache 2 (an OSI approved license). The project is governed by a Project Lead.
For project documentation, please visit the xUnit.net project home.
| Latest stable | Latest CI (how to use) | Build status | |
|---|---|---|---|
xunit.v3 | |||
xunit | |||
xunit.analyzers | |||
xunit.runner.visualstudio |
For complete CI package lists, please visit the feedz.io package search. A free login is required.
Help support this project by becoming a sponsor through GitHub Sponsors.