tunit-testing-quality

Enforces TUnit-first testing conventions, naming patterns, and CI reliability gates for .NET test suites.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/MartiXDev/ai-dev-strategy --skill tunit-testing-quality-martixdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tunit-testing-quality
Source: https://github.com/MartiXDev/ai-dev-strategy/tree/main/plugins/dotnet-testing-quality/skills/tunit-testing-quality
Command: npx skills add https://github.com/MartiXDev/ai-dev-strategy --skill tunit-testing-quality-martixdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? .NET teams often end up with inconsistent test frameworks, unclear naming, flaky tests, and missing quality gates. This Skill standardizes test creation and review around TUnit, with clear rules for when xUnit fallback is acceptable and which gates must pass before merging. ## Core Features & Use Cases - TUnit-First Conventions: Enforces async TUnit assertions, parallel-safe test design, and the Should_<ExpectedBehavior>_When_<Condition>() naming pattern. - Integration-Test Fallback Guidance: Defines when xUnit fallback is justified (e.g., WebApplicationFactory<TEntryPoint>) and how to mark it with a reason comment. - Reliability Gates: Applies six pre-merge gates covering build, TUnit suite, integration tests, determinism, flakiness, and naming. - Use Case: When reviewing a pull request that adds new C# tests, use this Skill to verify naming conventions, check for Thread.Sleep or shared mutable state, and confirm all reliability gates pass before approval. ## Quick Start Review my new .NET test files and check them against the TUnit naming pattern and reliability gates.

Frequently Asked Questions about tunit-testing-quality

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

FAQPage Schema
How do I name TUnit test methods in .NET?

TUnit test methods should follow the pattern Should_<ExpectedBehavior>_When_<Condition>(), such as Should_CreateUser_When_CommandIsValid(). This makes test intent obvious from the method name and keeps naming consistent across the suite.

When should I use xUnit instead of TUnit for .NET tests?

Use xUnit fallback only when integration infrastructure requires it, such as WebApplicationFactory<TEntryPoint> or an xUnit-bound dependency. Keep fallback tests scoped to integration coverage and add a header comment like '// xUnit fallback — reason: WebApplicationFactory integration'.

How do I prevent flaky tests in a TUnit test suite?

Keep tests parallel-safe by default, isolate mutable state per test, and avoid Thread.Sleep and order-dependent tests. Rerun the impacted test set before merging to confirm results are stable, and use [NotInParallel] only when a shared external resource makes it unavoidable.

What CI gates should run before merging .NET test changes?

Run six gates: dotnet build succeeds, the TUnit unit/component suite passes, integration fallback tests pass, no determinism violations exist, reruns show stable results, and new tests follow approved naming patterns.

Can I convert existing TUnit tests to xUnit?

No, existing healthy TUnit unit tests should not be converted to xUnit. The xUnit fallback applies only to new integration coverage where infrastructure requires it, keeping the rest of the suite on TUnit.