Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

1.1 KB
Raw Blame

paths: - "/*.cs" - "/.csx" - "**/.csproj"

C# Testing

This file extends common/testing.md with C#-specific content.

Test Framework

  • Prefer xUnit for unit and integration tests
  • Use AwesomeAssertions for readable assertions
  • Use Moq or NSubstitute for mocking dependencies
  • Use Testcontainers when integration tests need real infrastructure

Test Organization

  • Mirror src/ structure under tests/
  • Separate unit, integration, and end-to-end coverage clearly
  • Name tests by behavior, not implementation details
public sealed class OrderServiceTests
{
    [Fact]
    public async Task FindByIdAsync_ReturnsOrder_WhenOrderExists()
    {
        // Arrange
        // Act
        // Assert
    }
}

ASP.NET Core Integration Tests

  • Use WebApplicationFactory<TEntryPoint> for API integration coverage
  • Test auth, validation, and serialization through HTTP, not by bypassing middleware

Coverage

  • Target 80%+ line coverage
  • Focus coverage on domain logic, validation, auth, and failure paths
  • Run dotnet test in CI with coverage collection enabled where available