Skip to content

thomhurst/TUnit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 The Modern Testing Framework for .NET

TUnit is a next-generation testing framework for C# that outpaces traditional frameworks with source-generated tests, parallel execution by default, and Native AOT support. Built on the modern Microsoft.Testing.Platform, TUnit delivers faster test runs, better developer experience, and unmatched flexibility.

thomhurst%2FTUnit | Trendshift

Codacy BadgeGitHub Repo stars GitHub Issues or Pull Requests GitHub Sponsors nuget NuGet Downloads GitHub Workflow Status (with event) GitHub last commit (branch) License

⚡ Why Choose TUnit?

Feature Traditional Frameworks TUnit
Test Discovery ❌ Runtime reflection Compile-time generation
Execution Speed ❌ Sequential by default Parallel by default
Modern .NET ⚠️ Limited AOT support Full Native AOT & trimming
Test Dependencies ❌ Not supported [DependsOn] chains
Resource Management ❌ Manual lifecycle Intelligent cleanup

Parallel by Default - Tests run concurrently with intelligent dependency management

🎯 Compile-Time Discovery - Know your test structure before runtime

🔧 Modern .NET Ready - Native AOT, trimming, and latest .NET features

🎭 Extensible - Customize data sources, attributes, and test behavior


🚀 New to TUnit? Start with our Getting Started Guide

🔄 Migrating? See our Migration Guides

🎯 Advanced Features? Explore Data-Driven Testing, Test Dependencies, and Parallelism Control


🏁 Quick Start

Using the Project Template (Recommended)

dotnet new install TUnit.Templates
dotnet new TUnit -n "MyTestProject"

Manual Installation

dotnet add package TUnit --prerelease

📖 📚 Complete Documentation & Guides - Everything you need to master TUnit

✨ Key Features

🚀 Performance & Modern Platform

  • 🔥 Source-generated tests (no reflection)
  • ⚡ Parallel execution by default
  • 🚀 Native AOT & trimming support
  • 📈 Optimized for performance

🎯 Advanced Test Control

  • 🔗 Test dependencies with [DependsOn]
  • 🎛️ Parallel limits & custom scheduling
  • 🛡️ Built-in analyzers & compile-time checks
  • 🎭 Custom attributes & extensible conditions

📊 Rich Data & Assertions

  • 📋 Multiple data sources ([Arguments], [Matrix], [ClassData])
  • ✅ Fluent async assertions
  • 🔄 Smart retry logic & conditional execution
  • 📝 Rich test metadata & context

🔧 Developer Experience

  • 💉 Full dependency injection support
  • 🪝 Comprehensive lifecycle hooks
  • 🎯 IDE integration (VS, Rider, VS Code)
  • 📚 Extensive documentation & examples

📝 Simple Test Example

[Test]
public async Task User_Creation_Should_Set_Timestamp()
{
    // Arrange
    var userService = new UserService();

    // Act
    var user = await userService.CreateUserAsync("john.doe@example.com");

    // Assert - TUnit's fluent assertions
    await Assert.That(user.CreatedAt)
        .IsEqualTo(DateTime.Now)
        .Within(TimeSpan.FromMinutes(1));

    await Assert.That(user.Email)
        .IsEqualTo("john.doe@example.com");
}

🎯 Data-Driven Testing

[Test]
[Arguments("user1@test.com", "ValidPassword123")]
[Arguments("user2@test.com", "AnotherPassword456")]
[Arguments("admin@test.com", "AdminPass789")]
public async Task User_Login_Should_Succeed(string email, string password)
{
    var result = await authService.LoginAsync(email, password);
    await Assert.That(result.IsSuccess).IsTrue();
}

// Matrix testing - tests all combinations
[Test]
[MatrixDataSource]
public async Task Database_Operations_Work(
    [Matrix("Create", "Update", "Delete")] string operation,
    [Matrix("User", "Product", "Order")] string entity)
{
    await Assert.That(await ExecuteOperation(operation, entity))
        .IsTrue();
}

🔗 Advanced Test Orchestration

[Before(Class)]
public static async Task SetupDatabase(ClassHookContext context)
{
    await DatabaseHelper.InitializeAsync();
}

[Test, DisplayName("Register a new account")]
[MethodDataSource(nameof(GetTestUsers))]
public async Task Register_User(string username, string password)
{
    // Test implementation
}

[Test, DependsOn(nameof(Register_User))]
[Retry(3)] // Retry on failure
public async Task Login_With_Registered_User(string username, string password)
{
    // This test runs after Register_User completes
}

[Test]
[ParallelLimit<LoadTestParallelLimit>] // Custom parallel control
[Repeat(100)] // Run 100 times
public async Task Load_Test_Homepage()
{
    // Performance testing
}

// Custom attributes
[Test, WindowsOnly, RetryOnHttpError(5)]
public async Task Windows_Specific_Feature()
{
    // Platform-specific test with custom retry logic
}

public class LoadTestParallelLimit : IParallelLimit
{
    public int Limit => 10; // Limit to 10 concurrent executions
}

🔧 Smart Test Control

// Custom conditional execution
public class WindowsOnlyAttribute : SkipAttribute
{
    public WindowsOnlyAttribute() : base("Windows only test") { }

    public override Task<bool> ShouldSkip(TestContext testContext)
        => Task.FromResult(!OperatingSystem.IsWindows());
}

// Custom retry logic
public class RetryOnHttpErrorAttribute : RetryAttribute
{
    public RetryOnHttpErrorAttribute(int times) : base(times) { }

    public override Task<bool> ShouldRetry(TestInformation testInformation,
        Exception exception, int currentRetryCount)
        => Task.FromResult(exception is HttpRequestException { StatusCode: HttpStatusCode.ServiceUnavailable });
}

🎯 Perfect For Every Testing Scenario

🧪 Unit Testing

[Test]
[Arguments(1, 2, 3)]
[Arguments(5, 10, 15)]
public async Task Calculate_Sum(int a, int b, int expected)
{
    await Assert.That(Calculator.Add(a, b))
        .IsEqualTo(expected);
}

Fast, isolated, and reliable

🔗 Integration Testing

[Test, DependsOn(nameof(CreateUser))]
public async Task Login_After_Registration()
{
    // Runs after CreateUser completes
    var result = await authService.Login(user);
    await Assert.That(result.IsSuccess).IsTrue();
}

Stateful workflows made simple

Load Testing

[Test]
[ParallelLimit<LoadTestLimit>]
[Repeat(1000)]
public async Task API_Handles_Concurrent_Requests()
{
    await Assert.That(await httpClient.GetAsync("/api/health"))
        .HasStatusCode(HttpStatusCode.OK);
}

Built-in performance testing

🚀 What Makes TUnit Different?

Compile-Time Intelligence

Tests are discovered at build time, not runtime - enabling faster discovery, better IDE integration, and precise resource lifecycle management.

Parallel-First Architecture

Built for concurrency from day one with [DependsOn] for test chains, [ParallelLimit] for resource control, and intelligent scheduling.

Extensible by Design

The DataSourceGenerator<T> pattern and custom attribute system let you extend TUnit's capabilities without modifying core framework code.

🏆 Community & Ecosystem

🌟 Join thousands of developers modernizing their testing

Downloads Contributors Discussions

🤝 Active Community

🛠️ IDE Support

TUnit works seamlessly across all major .NET development environments:

Visual Studio (2022 17.13+)

Fully supported - No additional configuration needed for latest versions

⚙️ Earlier versions: Enable "Use testing platform server mode" in Tools > Manage Preview Features

JetBrains Rider

Fully supported

⚙️ Setup: Enable "Testing Platform support" in Settings > Build, Execution, Deployment > Unit Testing > VSTest

Visual Studio Code

Fully supported

⚙️ Setup: Install C# Dev Kit and enable "Use Testing Platform Protocol"

Command Line

Full CLI support - Works with dotnet test, dotnet run, and direct executable execution

📦 Package Options

Package Use Case
TUnit Start here - Complete testing framework (includes Core + Engine + Assertions)
TUnit.Core 📚 Test libraries and shared components (no execution engine)
TUnit.Engine 🚀 Test execution engine and adapter (for test projects)
TUnit.Assertions ✅ Standalone assertions (works with any test framework)
TUnit.Playwright 🎭 Playwright integration with automatic lifecycle management

🎯 Migration from Other Frameworks

Coming from NUnit or xUnit? TUnit maintains familiar syntax while adding modern capabilities:

// Enhanced with TUnit's advanced features
[Test]
[Arguments("value1")]
[Arguments("value2")]
[Retry(3)]
[ParallelLimit<CustomLimit>]
public async Task Modern_TUnit_Test(string value) { }

📖 Need help migrating? Check our detailed Migration Guides with step-by-step instructions for xUnit, NUnit, and MSTest.

💡 Current Status

The API is mostly stable, but may have some changes based on feedback or issues before v1.0 release.


🚀 Ready to Experience the Future of .NET Testing?

Start in 30 Seconds

# Create a new test project with examples
dotnet new install TUnit.Templates && dotnet new TUnit -n "MyAwesomeTests"

# Or add to existing project
dotnet add package TUnit --prerelease

🎯 Why Wait? Join the Movement

📈 Performance

Optimized execution Parallel by default Zero reflection overhead

🔮 Future-Ready

Native AOT support Latest .NET features Source generation

🛠️ Developer Experience

Compile-time checks Rich IDE integration Intelligent debugging

🎭 Flexibility

Test dependencies Custom attributes Extensible architecture


📖 Learn More: tunit.dev | 💬 Get Help: GitHub Discussions | ⭐ Show Support: Star on GitHub

TUnit is actively developed and production-ready. Join our growing community of developers who've made the switch!

Performance Benchmark

Scenario: Building the test project

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
Build_TUnit 0.57.24 1.777 s 0.1518 s 0.4453 s 1.647 s
Build_NUnit 4.4.0 1.943 s 0.2288 s 0.6602 s 1.786 s
Build_xUnit 2.9.3 1.443 s 0.1012 s 0.2871 s 1.431 s
Build_MSTest 3.10.4 1.255 s 0.0723 s 0.2074 s 1.209 s

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
Build_TUnit 0.57.24 1.829 s 0.0365 s 0.0762 s 1.793 s
Build_NUnit 4.4.0 1.505 s 0.0144 s 0.0128 s 1.502 s
Build_xUnit 2.9.3 1.514 s 0.0126 s 0.0112 s 1.509 s
Build_MSTest 3.10.4 1.512 s 0.0171 s 0.0152 s 1.516 s

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
Build_TUnit 0.57.24 1.840 s 0.0363 s 0.0635 s 1.826 s
Build_NUnit 4.4.0 1.565 s 0.0194 s 0.0172 s 1.566 s
Build_xUnit 2.9.3 1.582 s 0.0293 s 0.0380 s 1.577 s
Build_MSTest 3.10.4 1.575 s 0.0198 s 0.0185 s 1.578 s

Scenario: Tests focused on assertion performance and validation

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.NUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.xUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.NUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.xUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.NUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.xUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

Scenario: Tests running asynchronous operations and async/await patterns

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 195.3 ms 15.81 ms 46.38 ms 177.7 ms
TUnit 0.57.24 704.1 ms 32.39 ms 93.98 ms 693.1 ms
NUnit 4.4.0 1,083.5 ms 56.99 ms 166.24 ms 1,068.6 ms
xUnit 2.9.3 1,124.3 ms 70.15 ms 204.62 ms 1,076.1 ms
MSTest 3.10.4 993.6 ms 52.65 ms 152.75 ms 976.6 ms

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 27.52 ms 0.400 ms 0.374 ms 27.55 ms
TUnit 0.57.24 959.46 ms 19.096 ms 19.611 ms 962.41 ms
NUnit 4.4.0 1,343.67 ms 18.501 ms 17.305 ms 1,344.93 ms
xUnit 2.9.3 1,435.93 ms 8.235 ms 7.703 ms 1,435.82 ms
MSTest 3.10.4 1,289.02 ms 12.733 ms 11.911 ms 1,286.16 ms

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 62.19 ms 0.638 ms 0.533 ms 62.37 ms
TUnit 0.57.24 986.32 ms 19.289 ms 22.963 ms 984.83 ms
NUnit 4.4.0 1,362.22 ms 10.637 ms 9.429 ms 1,359.81 ms
xUnit 2.9.3 1,451.36 ms 10.301 ms 8.602 ms 1,450.18 ms
MSTest 3.10.4 1,289.29 ms 11.888 ms 11.120 ms 1,289.43 ms

Scenario: Simple tests with basic operations and assertions

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 133.2 ms 6.24 ms 18.10 ms 127.8 ms
TUnit 0.57.24 942.9 ms 96.69 ms 271.14 ms 906.2 ms
NUnit 4.4.0 897.1 ms 37.05 ms 105.11 ms 871.5 ms
xUnit 2.9.3 860.6 ms 30.68 ms 90.47 ms 850.1 ms
MSTest 3.10.4 994.4 ms 65.90 ms 193.26 ms 963.7 ms

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 27.34 ms 0.198 ms 0.165 ms 27.31 ms
TUnit 0.57.24 968.68 ms 17.976 ms 15.935 ms 965.65 ms
NUnit 4.4.0 1,345.92 ms 12.120 ms 10.744 ms 1,347.19 ms
xUnit 2.9.3 1,426.58 ms 11.762 ms 11.002 ms 1,425.33 ms
MSTest 3.10.4 1,303.80 ms 13.469 ms 12.599 ms 1,302.59 ms

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 59.93 ms 1.047 ms 0.928 ms 60.22 ms
TUnit 0.57.24 1,003.02 ms 19.885 ms 21.277 ms 1,002.03 ms
NUnit 4.4.0 1,352.25 ms 7.621 ms 6.756 ms 1,352.07 ms
xUnit 2.9.3 1,436.06 ms 22.160 ms 20.729 ms 1,439.22 ms
MSTest 3.10.4 1,332.82 ms 19.422 ms 18.167 ms 1,333.86 ms

Scenario: Parameterized tests with multiple test cases using data attributes

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 869.3 ms 33.97 ms 96.90 ms 867.5 ms
xUnit 2.9.3 1,036.2 ms 54.62 ms 158.45 ms 1,021.6 ms
MSTest 3.10.4 941.7 ms 46.00 ms 134.19 ms 896.9 ms

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0)

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 1.284 s 0.0128 s 0.0113 s 1.287 s
xUnit 2.9.3 1.351 s 0.0113 s 0.0100 s 1.347 s
MSTest 3.10.4 1.229 s 0.0056 s 0.0050 s 1.230 s

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0)

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 1.343 s 0.0111 s 0.0099 s 1.341 s
xUnit 2.9.3 1.416 s 0.0193 s 0.0180 s 1.411 s
MSTest 3.10.4 1.306 s 0.0118 s 0.0110 s 1.306 s

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0)

Scenario: Tests utilizing class fixtures and shared test context

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 160.6 ms 11.32 ms 32.83 ms 153.8 ms
TUnit 0.57.24 695.6 ms 40.42 ms 112.68 ms 659.2 ms
NUnit 4.4.0 1,198.8 ms 97.51 ms 282.90 ms 1,146.0 ms
xUnit 2.9.3 983.4 ms 37.64 ms 110.39 ms 980.3 ms
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 27.61 ms 0.455 ms 0.403 ms 27.54 ms
TUnit 0.57.24 976.03 ms 19.421 ms 19.074 ms 970.66 ms
NUnit 4.4.0 1,366.99 ms 18.143 ms 16.971 ms 1,367.51 ms
xUnit 2.9.3 1,447.62 ms 15.351 ms 13.608 ms 1,446.35 ms
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 49.09 ms 0.973 ms 1.572 ms 48.50 ms
TUnit 0.57.24 993.25 ms 19.302 ms 22.228 ms 982.94 ms
NUnit 4.4.0 1,326.67 ms 15.375 ms 14.382 ms 1,321.32 ms
xUnit 2.9.3 1,385.54 ms 5.316 ms 4.712 ms 1,384.96 ms
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

Scenario: Tests executing in parallel to test framework parallelization

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 129.6 ms 6.66 ms 19.33 ms 122.2 ms
TUnit 0.57.24 736.7 ms 62.00 ms 178.90 ms 669.8 ms
NUnit 4.4.0 1,253.6 ms 116.28 ms 341.02 ms 1,152.7 ms
xUnit 2.9.3 972.7 ms 40.70 ms 117.42 ms 942.4 ms
MSTest 3.10.4 995.8 ms 47.23 ms 134.76 ms 1,000.7 ms

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 26.78 ms 0.222 ms 0.185 ms 26.72 ms
TUnit 0.57.24 952.75 ms 18.734 ms 20.823 ms 952.52 ms
NUnit 4.4.0 1,315.31 ms 10.331 ms 9.664 ms 1,315.26 ms
xUnit 2.9.3 1,396.66 ms 10.616 ms 9.930 ms 1,396.88 ms
MSTest 3.10.4 1,268.99 ms 15.032 ms 14.061 ms 1,272.86 ms

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 54.33 ms 0.979 ms 1.128 ms 54.36 ms
TUnit 0.57.24 1,017.26 ms 18.757 ms 33.823 ms 1,021.02 ms
NUnit 4.4.0 1,379.56 ms 10.386 ms 9.715 ms 1,378.37 ms
xUnit 2.9.3 1,462.34 ms 15.516 ms 14.513 ms 1,462.16 ms
MSTest 3.10.4 1,336.19 ms 17.522 ms 16.391 ms 1,338.07 ms

Scenario: A test that takes 50ms to execute, repeated 100 times

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.NUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.xUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.NUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.xUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 NA NA NA NA
TUnit 0.57.24 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.4 NA NA NA NA

Benchmarks with issues: RuntimeBenchmarks.TUnit_AOT: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.TUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.NUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.xUnit: Job-YNJDZW(Runtime=.NET 9.0) RuntimeBenchmarks.MSTest: Job-YNJDZW(Runtime=.NET 9.0)

Scenario: Tests with setup and teardown lifecycle methods

macos-latest


BenchmarkDotNet v0.15.2, macOS Sequoia 15.5 (24F74) [Darwin 24.5.0]
Apple M1 (Virtual), 1 CPU, 3 logical and 3 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 198.7 ms 14.97 ms 43.42 ms 189.8 ms
TUnit 0.57.24 1,014.6 ms 50.96 ms 147.04 ms 997.4 ms
NUnit 4.4.0 1,057.4 ms 70.58 ms 193.21 ms 1,011.9 ms
xUnit 2.9.3 1,094.2 ms 82.07 ms 238.09 ms 1,021.1 ms
MSTest 3.10.4 965.9 ms 44.68 ms 129.62 ms 939.7 ms

ubuntu-latest


BenchmarkDotNet v0.15.2, Linux Ubuntu 24.04.3 LTS (Noble Numbat)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 27.23 ms 0.157 ms 0.131 ms 27.22 ms
TUnit 0.57.24 969.17 ms 18.955 ms 21.068 ms 966.72 ms
NUnit 4.4.0 1,343.08 ms 8.487 ms 7.524 ms 1,341.48 ms
xUnit 2.9.3 1,406.74 ms 13.504 ms 12.631 ms 1,402.08 ms
MSTest 3.10.4 1,280.65 ms 7.565 ms 7.076 ms 1,281.05 ms

windows-latest


BenchmarkDotNet v0.15.2, Windows 10 (10.0.20348.4052) (Hyper-V)
AMD EPYC 7763 2.44GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 9.0.304
  [Host]     : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.24 54.15 ms 1.039 ms 1.277 ms 54.32 ms
TUnit 0.57.24 1,019.17 ms 19.348 ms 23.761 ms 1,019.21 ms
NUnit 4.4.0 1,339.18 ms 12.750 ms 11.926 ms 1,339.99 ms
xUnit 2.9.3 1,394.86 ms 13.877 ms 12.301 ms 1,392.03 ms
MSTest 3.10.4 1,281.52 ms 9.890 ms 9.251 ms 1,280.96 ms