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 supportGive 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.
[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);}One test. Three cases. Discovered at compile time.
Read the guidedotnet new install TUnit.Templatesdotnet new TUnit -n MyTestsdotnet run --project MyTests
The compiler already knows your code. TUnit puts that knowledge to work before your tests even start.
Explore the designSource generators turn your tests into executable code at build time, removing the need for runtime reflection to discover them.
Native AOT supportTests run concurrently by default. Add dependencies, limits, or shared resources when your suite needs more control.
Control parallel executionRoslyn analyzers catch invalid hooks, data-source mistakes, and missing assertion awaits while you’re writing your tests.
See assertion diagnosticsThe same testing framework, wherever your code takes you.
Test your endpoints with isolated clients and shared infrastructure.
View example Distributed appsBring your whole application into the test lifecycle.
View example Browser testsGive every test a clean browser context and page.
View example Test doublesSet up and verify source-generated, AOT-compatible mocks.
View exampleSee how TUnit compares with xUnit, NUnit, and MSTest, and find a familiar place to begin.
Compare frameworks