csharp-tunit
๐ฏSkillfrom github/awesome-copilot
Generates comprehensive unit test templates and mocking strategies for C# projects using NUnit, ensuring robust test coverage and code quality.
Overview
C# TUnit is a skill that provides best practices for writing effective unit tests using the TUnit testing framework for .NET 8.0+. It covers test structure without requiring class-level attributes, the fluent await Assert.That() assertion syntax, advanced lifecycle hooks at test/class/assembly/session levels, and rich data-driven testing with [Arguments], [MethodData], and [ClassData] attributes.
Key Features
- Modern Test Structure - Uses
[Test]attribute without requiring class-level fixtures, with lifecycle hooks via[Before(Test)],[After(Test)],[Before(Class)],[After(Class)], and session-level hooks - Fluent Async Assertions - Leverages TUnit's unique
await Assert.That()syntax with fluent constraint methods for expressive, readable test assertions - Rich Data-Driven Testing - Supports
[Arguments]for inline data,[MethodData]for method-based sources,[ClassData]for class-based sources, and customITestDataSourceimplementations - Dependency Management - Provides
[DependsOn]attribute for declaring test execution order when needed, while maintaining test independence as the default - AAA Pattern Enforcement - Follows Arrange-Act-Assert pattern with
MethodName_Scenario_ExpectedBehaviornaming convention and separate[ProjectName].Testsprojects
Who is this for?
This skill is for C# developers using .NET 8.0+ who want to adopt TUnit as their testing framework. It is particularly useful for developers coming from xUnit or NUnit who want to learn TUnit's unique features like async assertions, session-level hooks, and its attribute-based data-driven testing approach.
Same repository
github/awesome-copilot(224 items)
Installation
npx vibeindex add github/awesome-copilot --skill csharp-tunitnpx skills add github/awesome-copilot --skill csharp-tunit~/.claude/skills/csharp-tunit/SKILL.mdSKILL.md
More from this repository10
A community-curated collection of custom agents, prompts, instructions, and skills to enhance GitHub Copilot across different domains, languages, and use cases.
A community-curated collection of custom agents, prompts, instructions, and skills to enhance GitHub Copilot across different domains, languages, and use cases.
Generates comprehensive Product Requirements Documents (PRDs) by systematically analyzing requirements and crafting detailed technical specifications
A community-curated collection of custom agents, prompts, instructions, and skills to enhance GitHub Copilot across different domains, languages, and use cases.
Generates Excalidraw diagrams from natural language descriptions, creating visual representations of processes, systems, relationships, and ideas.
Expert technical writer guided by the Diataxis framework, creating tutorials, how-to guides, reference docs, and explanation pages for software documentation.
Automates browser interactions, debugging, and performance analysis using Chrome DevTools for comprehensive web page inspection and control.
Provides Spring Boot best practices covering project setup, dependency injection, REST API design, data access with JPA, security configuration, and testing strategies.
A community-curated collection of custom agents, prompts, instructions, and skills to enhance GitHub Copilot across different domains, languages, and use cases.
Manages GitHub Issues through the GitHub API, enabling creation, searching, labeling, and triaging of issues directly from the coding environment.