Skip to content
affaan-m avatar

Csharp Testing

C# and .NET testing patterns using xUnit, FluentAssertions, mocking, and integration test setups.

CCM score
73 of 100
skills.sh installs
10.7K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers unit test structure with Arrange-Act-Assert, parameterized [Theory] tests, and NSubstitute mocking
  • Includes ASP.NET Core integration tests via WebApplicationFactory and database tests via Testcontainers
  • Guides test project layout across unit, integration, and shared helper projects, plus test data builders
  • Designed for reviewing or writing xUnit tests, mocks, or integration tests in C# and .NET projects

Install

$ npx -y skills add affaan-m/ecc --skill csharp-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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);
    }

Details

Repository
github.com/affaan-m/ecc
Categories
.NET & C#, Testing & QA
First seen
Jul 14, 2026

Questions

What is the csharp-testing skill for?

The csharp-testing skill provides C# and .NET testing patterns using xUnit, FluentAssertions, mocking, integration tests and test organization practices. It covers arrange-act-assert unit tests, parameterized Theory tests, NSubstitute mocking, and ASP.NET Core integration tests with WebApplicationFactory and Testcontainers.

Where does csharp-testing rank among .NET and C# skills?

On the .NET and C# category page, csharp-testing ranks in the top 10. It sits alongside skills such as dotnet-backend-patterns, dotnet-best-practices and nuget-manager, and it focuses specifically on writing and reviewing tests.

How do I install the csharp-testing skill?

Run npx -y skills add affaan-m/ecc --skill csharp-testing -y in your project. Once installed, the agent can write and review xUnit tests, mocks and integration tests for your C# or .NET code.

Which tools does csharp-testing use for testing?

The skill builds on xUnit as the test framework, FluentAssertions for readable assertions, and NSubstitute or Moq for mocking dependencies. It also uses Testcontainers for real infrastructure in integration tests, WebApplicationFactory for ASP.NET Core, and Bogus for realistic test data.

More from affaan-m/ecc

All 257

Similar to Csharp Testing

More .NET & C#