NextUnit 1.13.0
dotnet add package NextUnit --version 1.13.0
NuGet\Install-Package NextUnit -Version 1.13.0
<PackageReference Include="NextUnit" Version="1.13.0" />
<PackageVersion Include="NextUnit" Version="1.13.0" />
<PackageReference Include="NextUnit" />
paket add NextUnit --version 1.13.0
#r "nuget: NextUnit, 1.13.0"
#:package NextUnit@1.13.0
#addin nuget:?package=NextUnit&version=1.13.0
#tool nuget:?package=NextUnit&version=1.13.0
NextUnit - Modern Testing for .NET 10+
NextUnit is a modern, high-performance test framework for .NET 10+ that combines:
- TUnit's modern architecture - Microsoft.Testing.Platform, Native AOT, source generators
- xUnit's familiar assertions - Classic
Assert.Equal(expected, actual), no fluent syntax
Quick Start
Installation
Simple - One Package (Recommended):
dotnet add package NextUnit
This meta-package includes everything you need:
- NextUnit.Core - Attributes, assertions, execution engine
- NextUnit.Generator - Source generator for zero-reflection discovery
- NextUnit.TestAdapter - VSTest adapter for Visual Studio Test Explorer
- Microsoft.NET.Test.Sdk - Test platform SDK
Configure Your Test Project
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NextUnit" Version="1.13.0" />
</ItemGroup>
</Project>
Note: No OutputType=Exe or Program.cs needed - NextUnit works as a class library with VSTest adapter.
Write Your First Test
using NextUnit;
public class CalculatorTests
{
[Test]
public void Add_TwoNumbers_ReturnsSum()
{
var result = 2 + 2;
Assert.Equal(4, result);
}
[Test]
[Arguments(1, 2, 3)]
[Arguments(5, 5, 10)]
public void Add_Parameterized(int a, int b, int expected)
{
Assert.Equal(expected, a + b);
}
}
Run Tests
dotnet test
Key Features
- Zero-reflection execution - Fast test discovery via source generators
- Rich assertions - Collections, strings, numerics with great error messages
- Test artifacts - Attach screenshots, logs, videos to test results
- Combined data sources -
[Values],[ValuesFromMember],[ValuesFrom<T>]with Cartesian product - Matrix data source -
[Matrix]for Cartesian product test generation - Class data source -
[ClassDataSource<T>]with shared instance support - Explicit tests -
[Explicit]to exclude from default runs - Roslyn analyzers - Compile-time validation of test code
- Multi-scope lifecycle - Test, Class, Assembly scopes
- Parallel control -
[ParallelLimit],[NotInParallel("key")],[ParallelGroup("name")] - Test dependencies -
[DependsOn]withProceedOnFailureoption - Native AOT compatible - Full trim and AOT support
Packages
| Package | Description | Size |
|---|---|---|
| NextUnit | Meta-package with all components (recommended) | 4.2 KB |
| NextUnit.Core | Core attributes, assertions, execution engine | 32.1 KB |
| NextUnit.Generator | Source generator for test discovery | 20.7 KB |
| NextUnit.TestAdapter | VSTest adapter for Visual Studio Test Explorer | 15.4 KB |
Total Size: 72.4 KB (ultra-lightweight!)
Documentation
What's Different from xUnit?
| Feature | xUnit | NextUnit |
|---|---|---|
| Test Attribute | [Fact] |
[Test] (clearer) |
| Parameterized | [Theory] + [InlineData] |
[Test] + [Arguments] |
| Discovery | Runtime reflection | Source generator (faster) |
| Parallelism | Limited control | Fine-grained with [ParallelLimit] |
| Lifecycle | Constructor + IDisposable |
Multi-scope [Before]/[After] |
| AOT Support | Limited | Full Native AOT compatible |
Contributing
Contributions welcome! See our Contributing Guide.
License
Acknowledgments
Inspired by:
- TUnit - Modern architecture, source generators
- xUnit - Ergonomic assertions, proven patterns
- NUnit/MSTest - Battle-tested reliability
Built with love for .NET 10+ developers who want modern performance with familiar syntax.
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.NET.Test.Sdk (>= 18.0.1)
- NextUnit.Core (>= 1.13.0)
- NextUnit.Generator (>= 1.13.0)
- NextUnit.TestAdapter (>= 1.13.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.13.0 | 274 | 1/24/2026 |
| 1.12.0 | 140 | 1/24/2026 |
| 1.11.0 | 116 | 1/24/2026 |
| 1.10.0 | 121 | 1/24/2026 |
| 1.9.0 | 122 | 1/22/2026 |
| 1.8.0 | 151 | 1/22/2026 |
| 1.7.1 | 874 | 1/19/2026 |
| 1.7.0 | 415 | 1/18/2026 |
| 1.6.9 | 135 | 1/18/2026 |
| 1.6.8 | 160 | 1/18/2026 |
| 1.6.7 | 122 | 1/18/2026 |
| 1.6.6 | 176 | 1/14/2026 |
| 1.6.2 | 1,152 | 12/20/2025 |
| 1.6.1 | 328 | 12/15/2025 |
| 1.6.0 | 512 | 12/14/2025 |
| 1.5.0 | 726 | 12/10/2025 |
| 1.4.0 | 934 | 12/10/2025 |
See https://github.com/crane-valley/NextUnit/blob/main/CHANGELOG.md for release notes.