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.1 1,307.9 ms 121.36 ms 350.16 ms 1,187.3 ms
Build_NUnit 4.4.0 910.7 ms 19.89 ms 58.35 ms 900.3 ms
Build_xUnit 2.9.3 832.4 ms 14.16 ms 12.56 ms 830.0 ms
Build_MSTest 3.10.3 855.6 ms 9.12 ms 8.09 ms 859.3 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
Build_TUnit 0.57.1 1.813 s 0.0282 s 0.0486 s 1.805 s
Build_NUnit 4.4.0 1.511 s 0.0147 s 0.0130 s 1.510 s
Build_xUnit 2.9.3 1.526 s 0.0148 s 0.0139 s 1.529 s
Build_MSTest 3.10.3 1.518 s 0.0108 s 0.0101 s 1.515 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.1 1.862 s 0.0372 s 0.0716 s 1.848 s
Build_NUnit 4.4.0 1.592 s 0.0315 s 0.0480 s 1.591 s
Build_xUnit 2.9.3 1.563 s 0.0310 s 0.0369 s 1.562 s
Build_MSTest 3.10.3 1.558 s 0.0201 s 0.0188 s 1.556 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.3 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.3 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.3 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.1 180.1 ms 15.39 ms 45.14 ms 173.5 ms
TUnit 0.57.1 884.6 ms 54.20 ms 152.00 ms 862.2 ms
NUnit 4.4.0 1,258.9 ms 96.68 ms 275.84 ms 1,220.1 ms
xUnit 2.9.3 1,206.2 ms 76.68 ms 221.25 ms 1,194.4 ms
MSTest 3.10.3 1,008.2 ms 62.90 ms 182.47 ms 1,002.8 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.1 27.29 ms 0.322 ms 0.285 ms 27.26 ms
TUnit 0.57.1 950.69 ms 18.758 ms 23.036 ms 950.02 ms
NUnit 4.4.0 1,322.19 ms 9.304 ms 8.248 ms 1,323.42 ms
xUnit 2.9.3 1,422.04 ms 19.472 ms 17.261 ms 1,416.32 ms
MSTest 3.10.3 1,270.40 ms 18.965 ms 17.740 ms 1,264.18 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.1 62.96 ms 0.923 ms 0.863 ms 62.48 ms
TUnit 0.57.1 1,003.65 ms 19.810 ms 29.037 ms 1,004.73 ms
NUnit 4.4.0 1,382.37 ms 15.200 ms 14.218 ms 1,381.82 ms
xUnit 2.9.3 1,470.74 ms 16.374 ms 13.673 ms 1,469.31 ms
MSTest 3.10.3 1,301.77 ms 12.075 ms 11.295 ms 1,300.51 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.1 183.6 ms 18.24 ms 53.51 ms 169.5 ms
TUnit 0.57.1 858.4 ms 75.70 ms 220.82 ms 809.4 ms
NUnit 4.4.0 1,581.0 ms 124.79 ms 362.03 ms 1,477.9 ms
xUnit 2.9.3 1,098.7 ms 48.65 ms 141.15 ms 1,099.5 ms
MSTest 3.10.3 972.8 ms 45.60 ms 130.11 ms 949.8 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.1 26.63 ms 0.455 ms 0.380 ms 26.61 ms
TUnit 0.57.1 953.01 ms 18.214 ms 19.489 ms 953.76 ms
NUnit 4.4.0 1,317.63 ms 9.536 ms 8.920 ms 1,317.31 ms
xUnit 2.9.3 1,382.13 ms 10.325 ms 9.658 ms 1,383.06 ms
MSTest 3.10.3 1,251.24 ms 8.539 ms 7.569 ms 1,250.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.1 61.94 ms 0.837 ms 0.783 ms 62.34 ms
TUnit 0.57.1 1,028.95 ms 20.477 ms 32.479 ms 1,032.16 ms
NUnit 4.4.0 1,392.07 ms 17.384 ms 15.411 ms 1,398.03 ms
xUnit 2.9.3 1,439.61 ms 18.680 ms 17.473 ms 1,444.64 ms
MSTest 3.10.3 1,343.57 ms 18.902 ms 17.681 ms 1,339.04 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 733.3 ms 9.94 ms 8.30 ms 734.7 ms
xUnit 2.9.3 750.6 ms 14.46 ms 13.52 ms 746.2 ms
MSTest 3.10.3 695.0 ms 10.51 ms 9.32 ms 692.6 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 1.340 s 0.0165 s 0.0155 s 1.339 s
xUnit 2.9.3 1.426 s 0.0165 s 0.0155 s 1.421 s
MSTest 3.10.3 1.304 s 0.0143 s 0.0134 s 1.307 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 1.335 s 0.0119 s 0.0105 s 1.333 s
xUnit 2.9.3 1.400 s 0.0251 s 0.0222 s 1.400 s
MSTest 3.10.3 1.293 s 0.0226 s 0.0251 s 1.288 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.1 103.8 ms 0.46 ms 0.36 ms 103.8 ms
TUnit 0.57.1 555.8 ms 9.47 ms 8.40 ms 554.7 ms
NUnit 4.4.0 731.8 ms 5.52 ms 4.90 ms 730.6 ms
xUnit 2.9.3 771.0 ms 7.48 ms 6.63 ms 772.9 ms
MSTest 3.10.3 707.7 ms 9.11 ms 8.07 ms 708.3 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.1 25.72 ms 0.115 ms 0.102 ms 25.73 ms
TUnit 0.57.1 942.90 ms 18.578 ms 18.246 ms 941.29 ms
NUnit 4.4.0 1,300.99 ms 9.612 ms 8.991 ms 1,299.35 ms
xUnit 2.9.3 1,380.49 ms 11.138 ms 10.419 ms 1,375.04 ms
MSTest 3.10.3 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.1 49.22 ms 0.942 ms 1.321 ms 48.61 ms
TUnit 0.57.1 993.37 ms 19.741 ms 21.123 ms 991.87 ms
NUnit 4.4.0 1,320.21 ms 8.410 ms 6.566 ms 1,322.27 ms
xUnit 2.9.3 1,391.29 ms 9.825 ms 8.710 ms 1,391.08 ms
MSTest 3.10.3 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.1 99.88 ms 0.808 ms 0.674 ms 99.68 ms
TUnit 0.57.1 542.66 ms 10.176 ms 10.888 ms 541.24 ms
NUnit 4.4.0 719.54 ms 12.406 ms 10.359 ms 718.09 ms
xUnit 2.9.3 757.57 ms 7.626 ms 5.954 ms 755.10 ms
MSTest 3.10.3 981.89 ms 38.466 ms 107.227 ms 977.00 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.1 25.43 ms 0.358 ms 0.318 ms 25.34 ms
TUnit 0.57.1 917.34 ms 18.010 ms 19.271 ms 917.26 ms
NUnit 4.4.0 1,284.38 ms 11.464 ms 10.724 ms 1,283.53 ms
xUnit 2.9.3 1,344.92 ms 7.368 ms 6.152 ms 1,345.70 ms
MSTest 3.10.3 1,223.55 ms 6.430 ms 5.369 ms 1,224.43 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.1 51.23 ms 1.020 ms 2.482 ms 51.39 ms
TUnit 0.57.1 988.32 ms 19.469 ms 23.176 ms 977.66 ms
NUnit 4.4.0 1,338.88 ms 15.721 ms 14.705 ms 1,341.01 ms
xUnit 2.9.3 1,397.72 ms 12.025 ms 11.248 ms 1,400.95 ms
MSTest 3.10.3 1,287.03 ms 13.337 ms 12.476 ms 1,283.34 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.3 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.3 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.1 NA NA NA NA
TUnit 0.57.1 NA NA NA NA
NUnit 4.4.0 NA NA NA NA
xUnit 2.9.3 NA NA NA NA
MSTest 3.10.3 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.1 118.0 ms 3.85 ms 10.99 ms 116.3 ms
TUnit 0.57.1 603.2 ms 11.69 ms 28.45 ms 597.1 ms
NUnit 4.4.0 803.9 ms 19.73 ms 58.19 ms 796.7 ms
xUnit 2.9.3 815.1 ms 16.27 ms 44.54 ms 814.8 ms
MSTest 3.10.3 747.8 ms 9.85 ms 8.73 ms 745.5 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.1 26.22 ms 0.499 ms 0.490 ms 26.29 ms
TUnit 0.57.1 939.94 ms 18.064 ms 20.078 ms 937.47 ms
NUnit 4.4.0 1,302.92 ms 18.846 ms 16.706 ms 1,304.90 ms
xUnit 2.9.3 1,372.07 ms 10.438 ms 9.764 ms 1,370.17 ms
MSTest 3.10.3 1,246.60 ms 11.828 ms 9.877 ms 1,249.06 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.1 47.79 ms 0.931 ms 0.871 ms 48.05 ms
TUnit 0.57.1 996.47 ms 19.464 ms 23.171 ms 986.64 ms
NUnit 4.4.0 1,332.71 ms 10.020 ms 9.372 ms 1,331.30 ms
xUnit 2.9.3 1,397.01 ms 14.555 ms 13.615 ms 1,392.04 ms
MSTest 3.10.3 1,288.64 ms 14.239 ms 13.319 ms 1,285.28 ms

About

A modern, fast and flexible .NET testing framework

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors 49