csharp-tunit

Guides writing and refactoring TUnit unit tests with data-driven patterns on .NET 8.0+.

Updated Aug 24, 2026
One-click install
npx skills add https://github.com/aggutierrez98/TP-TD --skill csharp-tunit-aggutierrez98
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: csharp-tunit
Source: https://github.com/aggutierrez98/TP-TD/tree/main/.agents/skills/csharp-tunit
Command: npx skills add https://github.com/aggutierrez98/TP-TD --skill csharp-tunit-aggutierrez98

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers migrating from xUnit or NUnit to TUnit often struggle with its different attribute model, asynchronous fluent assertions, and lifecycle hooks, leading to inconsistent or incorrect test code. ## Core Features & Use Cases - TUnit Test Authoring: Provides conventions for test structure, naming, AAA pattern, and lifecycle hooks like [Before(Test)] and [After(Class)]. - Data-Driven Testing: Covers [Arguments], [MethodData], [ClassData], and custom ITestDataSource implementations for parameterized tests. - Fluent Assertions: Guides usage of await Assert.That() with chaining via .And, .Or, and .Within for expressive validation. - xUnit Migration: Maps xUnit constructs ([Fact], [Theory], [InlineData], IClassFixture) to their TUnit equivalents. - Use Case: When refactoring an existing xUnit test suite to TUnit, apply the migration mappings to convert attributes and assertions while adopting parallel execution controls like [NotInParallel] and [ParallelLimit<T>]. ## Quick Start Help me write a TUnit data-driven test class for my Calculator service using [Arguments] and fluent assertions.

Frequently Asked Questions about csharp-tunit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write data-driven tests in TUnit?▼

Use the [Arguments] attribute for inline test data on a [Test] method, similar to xUnit's [InlineData]. For method-based data use [MethodData], for class-based data use [ClassData], or implement ITestDataSource for custom sources.

How to migrate from xUnit to TUnit?▼

Replace [Fact] and [Theory] with [Test], [InlineData] with [Arguments], and [MemberData] with [MethodData]. Convert Assert.Equal to await Assert.That(actual).IsEqualTo(expected), and replace constructors or IClassFixture with [Before(Test)] and [Before(Class)] hooks.

Does TUnit support parallel test execution?▼

TUnit runs tests in parallel by default, unlike xUnit which needs explicit configuration. Use [NotInParallel] to disable parallelism for specific tests and [ParallelLimit<T>] with custom limit classes to control concurrency.

What .NET version does TUnit require?▼

TUnit requires .NET 8.0 or higher. Create a separate test project named [ProjectName].Tests, reference the TUnit and TUnit.Assertions packages, and run tests with the standard dotnet test command.

Why are my TUnit assertions not executing?▼

All TUnit assertions are asynchronous and must be awaited. Writing Assert.That(value).IsEqualTo(expected) without await means the assertion never runs, so always use await Assert.That(...) in async test methods.