Thanks to visit codestin.com
Credit goes to github.com

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("[email protected]");

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

    await Assert.That(user.Email)
        .IsEqualTo("[email protected]");
}

🎯 Data-Driven Testing

[Test]
[Arguments("[email protected]", "ValidPassword123")]
[Arguments("[email protected]", "AnotherPassword456")]
[Arguments("[email protected]", "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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
Build_TUnit 0.57.65 998.4 ms 19.93 ms 54.90 ms 982.7 ms
Build_NUnit 4.4.0 886.8 ms 17.68 ms 22.36 ms 885.3 ms
Build_xUnit 2.9.3 838.0 ms 13.48 ms 11.95 ms 841.5 ms
Build_MSTest 3.10.4 888.0 ms 14.39 ms 12.76 ms 888.1 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
Build_TUnit 0.57.65 2.009 s 0.0341 s 0.0588 s 1.993 s
Build_NUnit 4.4.0 1.659 s 0.0245 s 0.0241 s 1.651 s
Build_xUnit 2.9.3 1.673 s 0.0119 s 0.0106 s 1.674 s
Build_MSTest 3.10.4 1.651 s 0.0225 s 0.0200 s 1.649 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
Build_TUnit 0.57.65 1.902 s 0.0358 s 0.0617 s 1.892 s
Build_NUnit 4.4.0 1.620 s 0.0246 s 0.0192 s 1.624 s
Build_xUnit 2.9.3 1.593 s 0.0118 s 0.0099 s 1.592 s
Build_MSTest 3.10.4 1.595 s 0.0243 s 0.0227 s 1.597 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 117.3 ms 2.20 ms 3.80 ms 116.7 ms
TUnit 0.57.65 644.2 ms 21.14 ms 62.34 ms 643.4 ms
NUnit 4.4.0 834.4 ms 16.59 ms 42.24 ms 825.3 ms
xUnit 2.9.3 857.9 ms 17.12 ms 27.65 ms 850.7 ms
MSTest 3.10.4 749.5 ms 14.52 ms 20.82 ms 745.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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 26.83 ms 0.286 ms 0.253 ms 26.75 ms
TUnit 0.57.65 941.37 ms 18.760 ms 23.039 ms 936.88 ms
NUnit 4.4.0 1,320.08 ms 15.759 ms 14.741 ms 1,324.42 ms
xUnit 2.9.3 1,409.23 ms 6.362 ms 5.639 ms 1,408.79 ms
MSTest 3.10.4 1,262.21 ms 8.275 ms 7.741 ms 1,266.27 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 63.29 ms 1.205 ms 1.289 ms 62.39 ms
TUnit 0.57.65 1,008.43 ms 19.997 ms 26.002 ms 1,014.13 ms
NUnit 4.4.0 1,384.82 ms 20.392 ms 19.075 ms 1,379.12 ms
xUnit 2.9.3 1,493.85 ms 29.727 ms 27.807 ms 1,496.95 ms
MSTest 3.10.4 1,337.31 ms 23.626 ms 22.100 ms 1,341.57 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 118.7 ms 3.06 ms 8.99 ms 119.0 ms
TUnit 0.57.65 583.6 ms 11.53 ms 21.37 ms 575.1 ms
NUnit 4.4.0 773.0 ms 14.84 ms 22.21 ms 767.6 ms
xUnit 2.9.3 807.9 ms 15.83 ms 23.70 ms 809.7 ms
MSTest 3.10.4 720.2 ms 13.20 ms 22.42 ms 716.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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 25.42 ms 0.171 ms 0.142 ms 25.35 ms
TUnit 0.57.65 936.64 ms 18.432 ms 18.928 ms 937.73 ms
NUnit 4.4.0 1,308.66 ms 13.959 ms 12.374 ms 1,313.45 ms
xUnit 2.9.3 1,376.12 ms 15.782 ms 14.763 ms 1,375.82 ms
MSTest 3.10.4 1,245.60 ms 8.665 ms 7.681 ms 1,248.01 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 57.21 ms 1.144 ms 3.189 ms 56.18 ms
TUnit 0.57.65 988.29 ms 19.635 ms 20.163 ms 993.13 ms
NUnit 4.4.0 1,335.06 ms 11.009 ms 9.759 ms 1,335.68 ms
xUnit 2.9.3 1,393.08 ms 11.420 ms 10.124 ms 1,396.70 ms
MSTest 3.10.4 1,279.26 ms 11.637 ms 10.315 ms 1,279.42 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 NA NA NA NA
NUnit 4.4.0 734.1 ms 14.33 ms 17.06 ms 728.0 ms
xUnit 2.9.3 745.4 ms 4.70 ms 3.67 ms 746.5 ms
MSTest 3.10.4 701.7 ms 11.84 ms 10.50 ms 700.8 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 NA NA NA NA
NUnit 4.4.0 1.324 s 0.0260 s 0.0267 s 1.312 s
xUnit 2.9.3 1.401 s 0.0264 s 0.0247 s 1.398 s
MSTest 3.10.4 1.254 s 0.0164 s 0.0153 s 1.255 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 NA NA NA NA
NUnit 4.4.0 1.377 s 0.0171 s 0.0160 s 1.374 s
xUnit 2.9.3 1.448 s 0.0266 s 0.0249 s 1.449 s
MSTest 3.10.4 1.322 s 0.0117 s 0.0104 s 1.318 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 175.1 ms 17.51 ms 51.64 ms 159.4 ms
TUnit 0.57.65 1,108.1 ms 77.65 ms 225.27 ms 1,069.5 ms
NUnit 4.4.0 1,496.6 ms 93.79 ms 276.55 ms 1,484.2 ms
xUnit 2.9.3 1,570.8 ms 74.74 ms 219.20 ms 1,558.4 ms
MSTest 3.10.4 1,451.5 ms 76.66 ms 224.82 ms 1,427.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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 26.56 ms 0.386 ms 0.342 ms 26.57 ms
TUnit 0.57.65 956.20 ms 18.774 ms 21.620 ms 948.85 ms
NUnit 4.4.0 1,320.44 ms 14.315 ms 13.390 ms 1,323.22 ms
xUnit 2.9.3 1,405.57 ms 11.671 ms 10.346 ms 1,404.40 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 52.54 ms 1.032 ms 1.147 ms 52.85 ms
TUnit 0.57.65 1,016.20 ms 20.138 ms 24.731 ms 1,011.41 ms
NUnit 4.4.0 1,354.75 ms 15.258 ms 14.272 ms 1,352.36 ms
xUnit 2.9.3 1,420.18 ms 15.523 ms 13.761 ms 1,423.91 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 111.4 ms 2.19 ms 4.26 ms 111.3 ms
TUnit 0.57.65 578.5 ms 11.31 ms 20.10 ms 580.6 ms
NUnit 4.4.0 775.8 ms 15.04 ms 13.33 ms 773.8 ms
xUnit 2.9.3 761.3 ms 15.04 ms 23.85 ms 752.9 ms
MSTest 3.10.4 685.3 ms 9.22 ms 7.70 ms 683.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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 24.86 ms 0.110 ms 0.086 ms 24.84 ms
TUnit 0.57.65 922.17 ms 17.747 ms 20.437 ms 916.78 ms
NUnit 4.4.0 1,288.65 ms 6.267 ms 5.556 ms 1,287.97 ms
xUnit 2.9.3 1,358.02 ms 10.744 ms 10.050 ms 1,356.46 ms
MSTest 3.10.4 1,229.75 ms 7.450 ms 6.969 ms 1,228.48 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 56.16 ms 1.117 ms 2.281 ms 55.73 ms
TUnit 0.57.65 1,027.09 ms 20.256 ms 24.876 ms 1,018.24 ms
NUnit 4.4.0 1,393.52 ms 10.580 ms 9.897 ms 1,391.55 ms
xUnit 2.9.3 1,452.52 ms 15.129 ms 13.412 ms 1,450.91 ms
MSTest 3.10.4 1,325.90 ms 18.093 ms 16.925 ms 1,326.68 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 NA NA NA NA
TUnit 0.57.65 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), Arm64 RyuJIT AdvSIMD

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 185.1 ms 18.96 ms 55.91 ms 175.9 ms
TUnit 0.57.65 903.9 ms 80.67 ms 224.87 ms 870.8 ms
NUnit 4.4.0 1,458.5 ms 119.39 ms 338.68 ms 1,374.2 ms
xUnit 2.9.3 1,301.3 ms 69.47 ms 201.56 ms 1,272.2 ms
MSTest 3.10.4 1,338.2 ms 98.64 ms 278.21 ms 1,257.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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 26.74 ms 0.234 ms 0.195 ms 26.75 ms
TUnit 0.57.65 952.86 ms 18.812 ms 20.129 ms 951.73 ms
NUnit 4.4.0 1,307.47 ms 9.242 ms 8.193 ms 1,307.71 ms
xUnit 2.9.3 1,371.30 ms 5.449 ms 4.830 ms 1,371.05 ms
MSTest 3.10.4 1,253.61 ms 9.405 ms 8.797 ms 1,255.89 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.305
  [Host]     : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2
  Job-YNJDZW : .NET 9.0.9 (9.0.925.41916), X64 RyuJIT AVX2

Runtime=.NET 9.0  

Method Version Mean Error StdDev Median
TUnit_AOT 0.57.65 60.80 ms 1.192 ms 1.924 ms 61.98 ms
TUnit 0.57.65 1,079.44 ms 20.990 ms 29.425 ms 1,081.48 ms
NUnit 4.4.0 1,460.39 ms 25.840 ms 24.171 ms 1,464.45 ms
xUnit 2.9.3 1,509.50 ms 24.136 ms 22.577 ms 1,503.23 ms
MSTest 3.10.4 1,380.38 ms 25.402 ms 23.761 ms 1,374.48 ms

About

A modern, fast and flexible .NET testing framework

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors 51