csharp-tunit

Guide developers in writing TUnit unit tests for .NET 8 projects.

Updated Aug 16, 2025
One-click install
npx skills add https://github.com/dodyg/blue-nile-pds --skill csharp-tunit-dodyg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-tunit
Source: https://github.com/dodyg/blue-nile-pds/tree/main/.agents/skills/csharp-tunit
Command: npx skills add https://github.com/dodyg/blue-nile-pds --skill csharp-tunit-dodyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides developers to write robust TUnit unit tests.

Core Features & Use Cases

  • Standard tests with TUnit's fluent assertions
  • Data-driven testing using Arguments, MethodData, and ClassData
  • Advanced lifecycle hooks like Before(Test) and After(Test)
  • Migration guidance from xUnit to TUnit and recommended project layouts
  • Clear test organization by feature with independent tests

Quick Start

Configure a test project and write TUnit tests following the recommended structure to validate a target class.

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?

To write data-driven unit tests in TUnit, use the Arguments, MethodData, and ClassData attributes to pass parameters directly to your test methods. This enables comprehensive validation of target classes across multiple input scenarios.

What is the best way to organize TUnit tests for a .NET 8 project?

The best way to organize TUnit tests is by grouping them by feature while ensuring tests remain independent. This recommended project layout structure keeps standard and data-driven tests cleanly separated for robust validation.

How do I migrate existing xUnit tests to TUnit?

Migrating xUnit tests to TUnit involves replacing existing attributes with TUnit's fluent assertions and lifecycle hooks. The provided migration guidance maps structural changes to transition your C# testing lifecycle smoothly.

Does TUnit support test lifecycle hooks like Before and After tests?

Yes, TUnit supports advanced test lifecycle hooks including Before(Test) and After(Test) methods. These hooks allow developers to manage setup and teardown logic effectively within standard C# unit testing scenarios.

Can I use fluent assertions for standard unit testing in TUnit?

Yes, standard tests in TUnit utilize fluent assertions to write robust unit tests. This enables developers to apply testing best practices and validate target classes with readable, expressive syntax in .NET 8 or higher.