csharp-tunit

Write C# unit tests using the TUnit framework with best practices.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/Cripacx/agentic-dotnet --skill csharp-tunit-cripacx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-tunit
Source: https://github.com/Cripacx/agentic-dotnet/tree/main/skills/csharp-tunit
Command: npx skills add https://github.com/Cripacx/agentic-dotnet --skill csharp-tunit-cripacx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write effective unit tests using the TUnit framework, ensuring code quality and reliability for C# .NET projects.

Core Features & Use Cases

  • Best Practices: Provides guidance on TUnit setup, test structure, and naming conventions.
  • Data-Driven Testing: Explains how to implement inline, method-based, and class-based data-driven tests.
  • Assertions: Details TUnit's fluent and asynchronous assertion API for robust test validation.
  • Advanced Features: Covers test repetition, retries, parallel execution, and conditional skipping.
  • Use Case: You need to write unit tests for a new C# class using TUnit and want to ensure you're following the latest best practices, including setting up data-driven tests for various scenarios.

Quick Start

Use the csharp-tunit skill to generate a basic TUnit test class for a given C# method.

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 unit tests in C# using TUnit?

TUnit data-driven unit tests in C# are implemented using inline, method-based, and class-based data source attributes. These constructs allow you to feed multiple test scenarios into a single test method for comprehensive coverage.

What is the best way to migrate xUnit tests to TUnit?

To migrate xUnit tests to TUnit, map equivalent test constructs such as facts and theories to TUnit's corresponding attributes. This Skill maps xUnit constructs to TUnit equivalents to streamline framework migration.

How do you write fluent asynchronous assertions in TUnit?

Fluent asynchronous assertions in TUnit use a chained API to validate test outcomes. This approach allows you to verify asynchronous operations robustly without manual event synchronization.

Does TUnit support parallel execution and test retries?

TUnit supports parallel execution and test retries for C# unit tests. These advanced features handle flaky tests by repeating execution and running tests concurrently to optimize suite performance.

How do I skip a test conditionally in TUnit?

Conditional skipping in TUnit is achieved using built-in attributes that bypass test execution dynamically. This ensures tests are only run when specific runtime conditions are met.