About xUnit.net

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, 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 on Twitter: @xunit, @jamesnewkirk, @bradwilson, @onovotny
Discussions are held on Slack. Not a member yet? Sign up now!
Resharper 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

Latest Builds

Core framework Analyzers Devices runner
Stable
Pre-Release (on NuGet)
CI Build (on MyGet)
For information about features and bug fixes, see the release notes.

Documentation

Getting Started

New to xUnit.net? These guides will help you get started. (If you're not sure which tutorial to use, start with the Desktop CLR tutorial.)

Configuration

Unit Test Parallelism

Other Topics

Frequently Asked Questions

Migration

Release Notes

VersionReleases
2.3 RTM RC 3 RC 2 RC 1 Beta 5 Beta 4 Beta 3 Beta 2 Beta 1
2.2 RTM Beta 4 Beta 3 Beta 2 Beta 1
2.1 RTM RC 2 RC 1 Beta 4 Beta 3 Beta 2 Beta 1
2.0.1 RTM RC 1
2.0 RTM RC 4 RC 3 RC 2 RC 1 Beta 5

Test Runner Compatibility

  xUnit.net xunit.console 2 dotnet xunit 2 MSBuild TestDriven.NET Visual Studio 3 Devices
Desktop Class Library 1.9.2+ 5a 5a 5a 5a 5a (2012+)  
.NET Core
(Windows, Linux, OS X)
2.2+ 5a 5a     5a (2017+)  
Universal Windows Platform 2.1+         5a (2015+) 5b
Xamarin MonoAndroid 1 2.0+           5b
Xamarin iOS Unified 1 2.0+           5b
  ↓ The project types below are supported but generally discouraged 4
Portable Class Library 2.0+ 5a   5a 5a   5b
.NET Standard Class Library 1.1+ 2.2+ 5a   5a 5a   5b
  ↓ The project types below have been officially deprecated ↓
Universal Application
(Windows 8.1, Windows Phone 8.1)
2.0 - 2.1         5a (2013+) 5b
Windows Phone 8 (Silverlight) 2.0 - 2.1           5b
Xamarin MonoTouch (iOS Classic) 1 2.0 - 2.1           5b
  1. Requires Xamarin for Visual Studio or Xamarin Studio.
  2. dotnet xunit and dotnet xunit.console.dll only supports xUnit.net v2.3 and later.
  3. Visual Studio support includes the VS UI, vstest.console.exe, and dotnet test. Express editions are not supported.
  4. PCLs and netstandard libraries are linked against API sets, not frameworks, so several runners (Visual Studio, dotnet xunit, and dotnet test, plus potentially multi-framework third party runners) cannot determine the desired execution environment. Instead, your unit test projects should target platform-specific frameworks (like desktop CLR or netcoreapp). You can use multi-targeting when testing against multiple frameworks. Note that the library under test can still be a PCL or netstandard, and these suggestions only apply to the unit test project itself.
  5. Test runner source code availability:
        a https://github.com/xunit/xunit
        b https://github.com/xunit/devices.xunit

Github Projects

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

Additional copyrights

Portions copyright The Legion Of The Bouncy Castle

Laptop stickers!

Show your love for xUnit.net with one of our two laptop stickers, available from Sticker Mule.

Copyright © 2017 .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit.github.io.