Skip to content


Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time

About This Project

This project contains the assertion library source code, intended to be used as a Git submodule. Code here has a minimum target-framework of netstandard1.1, net452, or netcoreapp1.0.

To open an issue for this project, please visit the core project issue tracker.


The following pre-processor directives can be used to influence the resulting code contained in this repository:

XUNIT_NULLABLE (min: C# 9.0, v2)

Projects that consume this repository as source, which wish to use nullable reference type annotations should define the XUNIT_NULLABLE compilation symbol to opt-in to the relevant nullability analysis annotations on method signatures.

XUNIT_SKIP (min: C# 10.0, v3)

The Skip family of assertions (like Assert.Skip) require v3. Define this to enable the Skip assertions.

XUNIT_SPAN (min: C# 6.0, v2)

There are optimized versions of Assert.Equal for arrays which use Span<T>- and/or Memory<T>-based comparison options. If you are using a target framework that supports Span<T> and Memory<T>, you should define XUNIT_SPAN to enable these new assertions.

XUNIT_VALUETASK (min: C# 6.0, v2)

Any asynchronous assertion API (like Assert.ThrowsAsync) is available with versions that consume Task or Task<T>. If you are using a target framework and compiler that support ValueTask<T>, you should define XUNIT_VALUETASK to enable additional versions of those assertions that will consume ValueTask and/or ValueTask<T>.


By default, the Assert class has public visibility. This is appropriate for the default usage (as a shipped library). If your consumption of Assert via source is intended to be local to a single library, you should define XUNIT_VISIBILITY_INTERNAL to move the visibility of the Assert class to internal.

About is a free, open source, community-focused unit testing tool for the .NET Framework. Written by the original inventor of NUnit v2, is the latest technology for unit testing C#, F#, VB.NET and other .NET languages. 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).

For project documentation, please visit the project home.

About assertion library for sub-module purposes (please open issues in







No packages published