
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.
$ npx -y skills add github/awesome-copilot --skill csharp-xunit --agent claude-codeInstalls into .claude/skills of the current project.
Your goal is to help me write effective unit tests with XUnit, covering both standard and data-driven testing approaches.
[ProjectName].TestsCalculatorTests for Calculator)dotnet test for running tests[Fact] attribute for simple testsMethodName_Scenario_ExpectedBehaviorIDisposable.Dispose() for teardownIClassFixture<T> for shared context between tests in a classICollectionFixture<T> for shared context between multiple test classes[Theory] combined with data source attributes[InlineData] for inline test data[MemberData] for method-based test data[ClassData] for class-based test dataDataAttributeAssert.Equal for value equalityAssert.Same for reference equalityAssert.True/Assert.False for boolean conditionsAssert.Contains/Assert.DoesNotContain for collectionsAssert.Matches/Assert.DoesNotMatch for regex pattern matchingAssert.Throws<T> or await Assert.ThrowsAsync<T> to test exceptions[Trait("Category", "CategoryName")] for categorizationITestOutputHelper) for test diagnosticsSkip = "reason" in fact/theory attributesSponsors