
Csharp Xunit
This is Claude configured to help you write proper XUnit tests with a focus on real-world patterns. It covers the essentials like Arrange-Act-Assert structure, proper test naming conventions, and constructor/IDisposable setup patterns. Where it shines is data-driven testing guidance, walking you through InlineData, MemberData, and ClassData attributes plus custom data sources. It also handles test organization with class fixtures, collection fixtures, and trait categorization. The advice is practical and opinionated, pushing you toward independent tests and proper mocking patterns. Useful when you're setting up a new test project or trying to standardize your team's testing approach.
- skills.sh installs
- 10.4K
- GitHub stars
- 41K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add github/awesome-copilot --skill csharp-xunit --agent claude-codeInstalls into .claude/skills of the current project.
Files
XUnit Best Practices
Your goal is to help me write effective unit tests with XUnit, covering both standard and data-driven testing approaches.
Project Setup
- Use a separate test project with naming convention
[ProjectName].Tests - Reference Microsoft.NET.Test.Sdk, xunit, and xunit.runner.visualstudio packages
- Create test classes that match the classes being tested (e.g.,
CalculatorTestsforCalculator) - Use .NET SDK test commands:
dotnet testfor running tests
Test Structure
- No test class attributes required (unlike MSTest/NUnit)
- Use fact-based tests with
[Fact]attribute for simple tests - Follow the Arrange-Act-Assert (AAA) pattern
- Name tests using the pattern
MethodName_Scenario_ExpectedBehavior - Use constructor for setup and
IDisposable.Dispose()for teardown - Use
IClassFixture<T>for shared context between tests in a class - Use
ICollectionFixture<T>for shared context between multiple test classes
Standard Tests
Sponsors
Details
- Repository
- github.com/github/awesome-copilot
- Categories
- Testing & QA, Git & Pull Requests, AI & Agent Building, .NET & C#
More from github/awesome-copilot
All 318- Ai Prompt Engineering Safety Review10.4K
- Agentic Eval10.3K
- Create Architectural Decision Record10.3K
- Breakdown Feature Prd10.1K
- Refactor Method Complexity Reduce10K
- Powerbi Modeling10K
- Pdftk Server10K
- Scoutqa Test10K
- Nano Banana Pro Openrouter10K
- Markdown To Html9.9K
- Meeting Minutes9.9K
- Git Flow Branch Creator9.9K
- Dataverse Python Production Code9.8K
- Boost Prompt9.8K
- Kotlin Springboot9.8K
- Image Manipulation Image Magick9.8K
- Plantuml Ascii9.8K
- Readme Blueprint Generator9.7K
- Devops Rollout Plan9.7K
- My Pull Requests9.7K
- Csharp Docs9.7K
- Agent Governance9.7K
- Mcp Cli9.7K
- Context Map9.7K