This gives Claude solid patterns for testing .NET apps with xUnit, FluentAssertions, and NSubstitute. You get concrete examples for unit tests with proper AAA structure, parameterized tests with Theory, mocking patterns that actually work, and integration tests using WebApplicationFactory and Testcontainers for real databases. It covers test data builders, project organization, and calls out common mistakes like testing implementation details or using Thread.Sleep. Activate this when writing new tests, reviewing coverage, or setting up test infrastructure. The examples are production-ready, not toy code, which makes it immediately useful for real codebases.

skills.sh installs
3.6K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill csharp-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

C# Testing Patterns

Comprehensive testing patterns for .NET applications using xUnit, FluentAssertions, and modern testing practices.

When to Activate

  • Writing new tests for C# code
  • Reviewing test quality and coverage
  • Setting up test infrastructure for .NET projects
  • Debugging flaky or slow tests

Test Framework Stack

ToolPurpose
xUnitTest framework (preferred for .NET)
FluentAssertionsReadable assertion syntax
NSubstitute or MoqMocking dependencies
TestcontainersReal infrastructure in integration tests
WebApplicationFactoryASP.NET Core integration tests
BogusRealistic test data generation

Unit Test Structure

Arrange-Act-Assert

public sealed class OrderServiceTests
{
    private readonly IOrderRepository _repository = Substitute.For<IOrderRepository>();
    private readonly ILogger<OrderService> _logger = Substitute.For<ILogger<OrderService>>();
    private readonly OrderService _sut;

    public OrderServiceTests()
    {
        _sut = new OrderService(_repository, _logger);
    }

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
Testing & QA, .NET & C#
First seen
Apr 16, 2026

More from affaan-m/everything-claude-code

All 256
1sickn33 avatarplaywright-skillsickn33/antigravity-awesome-skillsplaywright skill3.5Kskills.sh installs
2everyinc avatarce-test-xcodeeveryinc/compound-engineering-pluginBuild and test iOS apps on simulator with XcodeBuildMCP.3Kskills.sh installs
3remotion-dev avatarweb-renderer-testremotion-dev/remotionAdd a test case to the web renderer2.9Kskills.sh installs
4chrisbanes avatarcompose-ui-testing-patternschrisbanes/skillsUse when writing or reviewing Jetpack Compose UI tests, screenshot tests, previews, semantics assertions, fake image loading, keyboard input, focus assertions, 2.5Kskills.sh installs
5hyf0 avatarvue-testing-best-practiceshyf0/vue-skillsvue testing best practices2.1Kskills.sh installs
6github avatarspring-boot-testinggithub/awesome-copilotExpert Spring Boot 4 testing specialist that selects the best Spring Boot testing techniques for your situation with Junit 6 and AssertJ.2.1Kskills.sh installs