Writing unit tests helps you catch bugs early and keep your code reliable. XUnit is a popular testing tool for .NET and C#. This guide shows you how to write clear and effective unit tests using XUnit.
You will learn about data-driven tests with Theory attributes. It also covers arranging your test code, making good assertions, and using mocks to isolate the code you test. The tips help you create tests that are easy to read and maintain.
Whether you are new to testing or want to improve your skills, these best practices will make your unit tests stronger and more useful for your whole team.
Global
mkdir -p ~/.claude/skills/csharp-xunitProject
mkdir -p .claude/skills/csharp-xunitSource Repository
Grill Memattpocock/skills
Stress-test your plan with relentless questions until we both understand
Tddmattpocock/skills
Write one test at a time then code to make it pass
Test Driven Developmentobra/superpowers
Write a failing test first then code just enough to pass
Qamattpocock/skills
Turn bug reports into GitHub issues through natural conversation without technical fuss
Migrate To Shoehornmattpocock/skills
Replace unsafe as assertions with type-safe partial test data easily
Webapp Testinganthropics/skills
Test your local web apps quickly with Playwright automation and screenshots
Playwright Best Practicescurrents-dev/playwright-best-practices-skill
Master Playwright testing with best practices for reliable and fast tests
Google Agents Cli Evalgoogle/agents-cli
Run evaluations on your AI agent, find failures, and improve its quality step by step