csharp-testing
C# and .NET testing patterns with xUnit, FluentAssertions, mocking, integration tests, and test organization best practices.
npx skills add mturac/everything-openai-codex --skill csharp-testing --agent codex
Same command for any agent — swap --agent for claude-code, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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 ```csharp 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); } [Fact] public async Task PlaceOrderAsync_ReturnsSuccess_WhenRequestIsValid() { // Arrange var request = new CreateOrder
- When to Activate
- Test Framework Stack
- Unit Test Structure
- Arrange-Act-Assert
- Parameterized Tests with Theory
- Mocking with NSubstitute
- ASP.NET Core Integration Tests
- WebApplicationFactory Setup
- Testing with Testcontainers
- Test Organization
- Test Data Builders
- Common Anti-Patterns
- Running Tests
Run all tests dotnet test Run with coverage dotnet test --collect:"XPlat Code Coverage" Run specific project dotnet test tests/MyApp.UnitTests/ Filter by test name dotnet test --filter "FullyQualifiedName~OrderService" Watch mode during development dotnet watch test --project tests/MyApp.UnitTests/
What does the csharp-testing skill do?
C# and .NET testing patterns with xUnit, FluentAssertions, mocking, integration tests, and test organization best practices.
How do I install it?
Run `npx skills add mturac/everything-openai-codex --skill csharp-testing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
