# thomhurst/TUnit

A modern, fast and flexible .NET testing framework

Repository: https://github.com/thomhurst/TUnit
Canonical: https://ross.abutalabs.com/products/tunit
Homepage: https://tunit.dev/
Language: C#
License: MIT
License Family: permissive
Topics: csharp, dotnet, test, testing
Last push: 2026-08-26T20:06:39+00:00

## Health v2 (maintenance only)
Score: 89/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 87, longevity 68
- inputs: {"age_days": 952, "days_push": 7, "days_rel": 7, "gap_med": 0, "n_releases_24m": 220}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3927, forks 130 (observed 2026-08-28T04:08:29.920172+00:00)

## What it is
TUnit is a modern, fast .NET testing framework built on Microsoft.Testing.Platform that discovers tests at compile time via Roslyn source generators and runs them in parallel by default. It includes fluent async assertions, Roslyn analyzers, an AOT-compatible mocking library, and first-class integrations for ASP.NET Core, Aspire, and Playwright.

## Use cases
- write unit tests in C# with a fast modern framework
- run .NET test suites in parallel for faster feedback
- test .NET code with Native AOT and trimming support
- write ASP.NET Core integration tests with per-test isolation
- run Playwright browser tests in .NET
- migrate from xUnit, NUnit, or MSTest
- mock dependencies in AOT-published test projects

## When to choose
- you want compile-time test discovery and fast startup instead of reflection-based frameworks
- you need Native AOT, trimming, or single-file publishing for your tests
- you want parallel-by-default execution with fine-grained control
- you're starting a new .NET project and want modern testing tooling

## When to avoid
- your team is deeply invested in xUnit, NUnit, or MSTest with no migration appetite
- you rely on runtime reflection-based test discovery or plugins
- you need a mocking library compatible with C# versions older than 14

## Facets
- artifact type: framework
- maturity: active
- function: testing, e2e-testing, mocking, benchmarking
- domain: testing, developer-tools, web-development
- platform: dotnet, cross-platform, cli
- tags: csharp, source-generators, native-aot, parallel-execution, unit-testing, integration-testing, aspnet-core, playwright, microsoft-testing-platform, xunit-alternative, docker

## Member repositories
- thomhurst/TUnit (main) score 89

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:29.920172+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:24:42.924704+00:00, confidence not recorded.
  - readme: https://github.com/thomhurst/TUnit (fetched 2026-08-28T04:08:29.920172+00:00, sha 9fdb55d96d45)
  - homepage: https://tunit.dev/ (fetched 2026-08-29T09:18:39.747637+00:00, sha 034fdbeb3fb9)
  - site_page: https://tunit.dev/docs/examples/aspnet (fetched 2026-08-29T09:18:39.766443+00:00, sha 48b4f90c0798)
  - site_page: https://tunit.dev/docs/intro (fetched 2026-08-29T09:18:39.756749+00:00, sha 659d5f1d5511)
  - site_page: https://tunit.dev/docs/getting-started/installation (fetched 2026-08-29T09:18:39.759330+00:00, sha a1c968b597bf)
  - site_page: https://tunit.dev/docs/guides/philosophy (fetched 2026-08-29T09:18:39.762210+00:00, sha 071cab9987e9)
  - site_page: https://tunit.dev/docs/benchmarks (fetched 2026-08-29T09:18:39.764408+00:00, sha a5c6de095bfd)
  - site_page: https://tunit.dev/docs/examples/aspire (fetched 2026-08-29T09:18:39.769653+00:00, sha 75f534dadd32)
  - site_page: https://tunit.dev/docs/examples/playwright (fetched 2026-08-29T09:18:39.772181+00:00, sha 982963102622)
  - site_page: https://tunit.dev/docs/writing-tests/mocking (fetched 2026-08-29T09:18:39.774499+00:00, sha 4670f9afd91a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
