
Csharp Testing
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-codeInstalls 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
| Tool | Purpose |
|---|---|
| xUnit | Test framework (preferred for .NET) |
| FluentAssertions | Readable assertion syntax |
| NSubstitute or Moq | Mocking dependencies |
| Testcontainers | Real infrastructure in integration tests |
| WebApplicationFactory | ASP.NET Core integration tests |
| Bogus | Realistic 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- Github Ops3.6K
- Hipaa Compliance3.6K
- Llm Trading Agent Security3.6K
- Project Flow Ops3.6K
- Social Graph Ranker3.6K
- Terminal Ops3.6K
- Defi Amm Security3.5K
- Ecc Tools Cost Audit3.5K
- Email Ops3.5K
- Hookify Rules3.5K
- Messages Ops3.5K
- Nodejs Keccak2563.5K
- Product Capability3.5K
- Research Ops3.5K
- Unified Notifications Ops3.5K
- Evm Token Decimals3.4K
- Gateguard3.1K
- Everything Claude Code2.7K
- Claude Api2.4K
- Hermes Imports2.3K
- Literature Review1.9K
- Fastapi Patterns1.8K
- Frontend Design1.8K
- Mysql Patterns1.8K