About xUnit.net

.NET Foundation logo

xUnit.net is a free, open source, community-focused unit testing tool for the .NET Framework. Written by the original inventor of NUnit v2, xUnit.net is the latest technology for unit testing C#, F#, VB.NET and other .NET languages. xUnit.net works with ReSharper/Rider, CodeRush, TestDriven.NET and Xamarin. It is part of the .NET Foundation, and operates under their code of conduct. It is licensed under Apache 2 (an OSI approved license).

Follow: xUnit.net on Mastodon, xUnit.net on BlueSky, James Newkirk, Brad Wilson, Claire Novotny
Discussions are held on our discussions site.
Resharper/Rider support is provided and supported by JetBrains.
CodeRush support is provided and supported by DevExpress.
NCrunch support is provided and supported by Remco Software.
The xUnit.net logo was designed by Nathan Young.

Table of Contents

Current Releases

  Stable Latest CI (how to use) Build status
v3 core framework
v2 core framework
xunit.analyzers
xunit.runner.visualstudio

Latest Release Notes

  Stable Prerelease  
v3 core framework   0.7.0-pre.15 (all releases)
v2 core framework 2.9.2   (all releases)
xunit.analyzers 1.17.0   (all releases)
xunit.runner.visualstudio 2.8.2 3.0.0-pre.49 (all releases)

Documentation

Getting Started

New to xUnit.net? These guides will help you get started.

v3 Core Framework (.NET 6+ and .NET Framework 4.7.2+, cross-platform)

v2 Core Framework

Source Analyzers

Configuration

Unit Test Parallelism

Frequently Asked Questions

Other Topics

Test Runner Compatibility

The following target frameworks are current supported:

  xUnit.net Console MSBuild TestDriven.NET 2 Visual Studio 3
.NET Framework
(Windows)
v1, v2, v3 4a 4a 4a 4b
.NET Core & .NET 5+
(Windows, Linux, macOS)
v2 (2.2+), v3       4b

The following target frameworks have been deprecated and are no longer supported:

  xUnit.net Visual Studio 2 Devices
Universal Application
(Win/WinPhone 8.1)
v2 (2.0 - 2.1) 4b 4c
Universal Windows Platform v2 (2.1 - 2.4.2) 4b 4c
Windows Phone 8 (Silverlight) v2 (2.0 - 2.1)   4c
Xamarin iOS Unified 1 v2 (2.0 - 2.4.2)   4c
Xamarin MonoAndroid 1 v2 (2.0 - 2.4.2)   4c
Xamarin MonoTouch (iOS Classic) 1 v2 (2.0 - 2.1)   4c
  1. Requires Xamarin for Visual Studio or Xamarin Studio.
  2. TestDriven.NET is no longer officially supported in v3 Core Framework, and is only available in Visual Studio 2019 and earlier.
  3. Visual Studio support includes the Visual Studio Test Explorer, Visual Studio Code, vstest.console.exe, and dotnet test. Express editions of Visual Studio are not supported. Minimum target frameworks for are higher for v2 Core Framework users: NET Framework 4.6.2+ and .NET 6+.
  4. Test runner source code availability:
    a. https://github.com/xunit/xunit
    b. https://github.com/xunit/visualstudio.xunit
    c. https://github.com/xunit/devices.xunit

Github Projects

For information on contributing to xUnit.net, please read the governance document.

Powered by NDepend

Sponsors

Special thanks to the .NET on AWS Open Source Software Fund for sponsoring the ongoing development of xUnit.net.

Help support this project by becoming a sponsor through GitHub Sponsors.

Additional copyrights

Portions copyright The Legion Of The Bouncy Castle

Copyright © .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit/tree/gh-pages.