Skip to main content
The testing framework for modern .NETOpen source, from the start

TUnit

Give your tests
a head start.

Discover tests while you compile. Run them in parallel. Get back to the code you came to write.

Source generated. Async native. AOT ready.

A little C#. A lot covered..NET
CalculatorTests.csClass members
[Test]
[Arguments(1, 2, 3)]
[Arguments(5, 8, 13)]
[Arguments(-1, 1, 0)]
public async Task Add(int a, int b, int expected)
{
await Assert.That(a + b)
.IsEqualTo(expected);
}
Example results3 passed
  • Add(1, 2, 3)Passed
  • Add(5, 8, 13)Passed
  • Add(-1, 1, 0)Passed

One test. Three cases. Discovered at compile time.

Read the guide
Your C# testsCompile-time discoveryParallel execution

Meet your next
test project.

Have the .NET SDK?
You’re three commands away.

Installation guide
  1. Install the templatedotnet new install TUnit.Templates
  2. Create your projectdotnet new TUnit -n MyTests
  3. Run your testsdotnet run --project MyTests

 

Good tests.
Less machinery.

The compiler already knows your code. TUnit puts that knowledge to work before your tests even start.

Explore the design

Discovered before you run.

Source generators turn your tests into executable code at build time, removing the need for runtime reflection to discover them.

Native AOT support

Parallel comes as standard.

Tests run concurrently by default. Add dependencies, limits, or shared resources when your suite needs more control.

Control parallel execution

Mistakes meet the compiler.

Roslyn analyzers catch invalid hooks, data-source mistakes, and missing assertion awaits while you’re writing your tests.

See assertion diagnostics

Small units.
Whole systems.

The same testing framework, wherever your code takes you.

Your next test
starts here.

Write your first test

Already have a test suite?

See how TUnit compares with xUnit, NUnit, and MSTest, and find a familiar place to begin.

Compare frameworks