[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7866D723KCW4TVRYZZAPFZ7":3,"skill-same:01M7866D723KCW4TVRYZZAPFZ7":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M7866D723KCW4TVRYZZAPFZ7","cs-testing",null,"Use ONLY when user explicitly requests C# test code, xUnit\u002FNSubstitute configuration, test failure diagnosis, or coverage improvement for .NET projects.\nTriggers: \"write test c#\", \"xunit\", \"NSubstitute\", \"Bogus\", \"AutoFixture\", \"dotnet test\", \"C# coverage\", \"coverlet\", \"FluentAssertions\", \"ASP.NET test\".\nDo NOT activate for: general C# coding without test context, NuGet package restore, MSBuild\u002Fproject configuration outside test scope, or .NET runtime issues.","chenziyang110\u002Flaunchdeck","chenziyang110","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43693913?v=4","01M7863EBWK1D0P6A29YGEMAS4","Robin11","01M7863ECM1VB6RXDMHTW90D2T",0,"MIT","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcs-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"cs-testing\"\ndescription: \"Use ONLY when user explicitly requests C# test code, xUnit\u002FNSubstitute configuration,\ntest failure diagnosis, or coverage improvement for .NET projects.\n\nTriggers: \\\"write test c#\\\", \\\"xunit\\\", \\\"NSubstitute\\\", \\\"Bogus\\\", \\\"AutoFixture\\\",\n\\\"dotnet test\\\", \\\"C# coverage\\\", \\\"coverlet\\\", \\\"FluentAssertions\\\", \\\"ASP.NET test\\\".\n\nDo NOT activate for: general C# coding without test context, NuGet package restore,\nMSBuild\u002Fproject configuration outside test scope, or .NET runtime issues.\n\"\ncompatibility: \"Requires spec-kit project structure with .specify\u002F directory\"\nmetadata:\n  author: \"github-spec-kit\"\n  source: \"templates\u002Fpassive-skills\u002Fcs-testing\u002FSKILL.md\"\n---\n\n\n# C# Testing (Agent Skill)\n\nAgent-focused testing workflow for modern C# (.NET 8+) using xUnit.net with NSubstitute (preferred) \u002F Moq (legacy) and FluentAssertions.\n\n## When to Use\n\n- Writing new C# tests or fixing existing tests\n- Designing unit\u002Fintegration test coverage for C# components\n- Adding test coverage, CI gating, or regression protection\n- Configuring xUnit \u002F NSubstitute \u002F Bogus workflows for consistent execution\n- Investigating test failures or flaky behavior\n- Testing ASP.NET Core, Blazor, or library code\n\n### When NOT to Use\n\n- Implementing new product features without test changes\n- Large-scale refactors unrelated to test coverage or failures\n- Performance tuning without test regressions to validate\n- Non-C# projects or non-test tasks\n\n### Stop Conditions — When to ASK instead of generating\n\nBefore generating any test code, STOP and ask the user if:\n- The code under test has **zero testability** (static methods everywhere, no DI, hard-coded `new HttpClient()`)\n- **No test framework** is detected (no xUnit\u002FNUnit in csproj, no `dotnet test` configuration)\n- The request is **ambiguous**: \"test my app\" or \"add tests\" without specifying files or classes\n- A **required test dependency** (xUnit, NSubstitute, FluentAssertions) is not installed\n- The test would require **secrets, real credentials, or production database access**\n\n## Core Concepts\n\n- **TDD loop**: red → green → refactor (tests first, minimal fix, then cleanups).\n- **Isolation**: prefer constructor injection and mocks over global state.\n- **Test layout**: `tests\u002FUnitTests\u002F`, `tests\u002FIntegrationTests\u002F`, mirror source namespace.\n- **Facts vs Theories**: `[Fact]` for single case, `[Theory]` with `[InlineData]` \u002F `[MemberData]`.\n- **Mocks vs fakes**: Moq for interaction verification, fakes for stateful behavior.\n- **CI signal**: `dotnet test` with `--collect:\"XPlat Code Coverage\"`.\n\n## Agent Execution Protocol\n\nWhen this skill is activated, follow this exact execution sequence:\n\n### Phase 1: Context Analysis\nBefore writing any test code:\n1. Identify the .NET version (8.0+) and build tool (SDK-style csproj).\n2. Check for existing test files (`tests\u002F`, `*Test.cs`) to infer naming conventions and style.\n3. Analyze the code under test: identify public API surface, side effects, async\u002Fawait usage, and DI patterns.\n4. Determine request type: (a) new tests, (b) fixing broken tests, (c) coverage improvement, (d) flaky test diagnosis.\n\n### Phase 2: Strategy Selection\nBased on Phase 1, select the appropriate strategy:\n- **Pure functions \u002F value objects**: unit tests only, no mocks needed. Use `[Fact]` or `[Theory]`.\n- **External dependencies (DB, HTTP, filesystem)**: use **NSubstitute** (preferred) or Moq (legacy only); prefer `WebApplicationFactory` for ASP.NET Core integration tests.\n- **Async code**: use `async Task` return type, never `async void`; use `CancellationToken` where applicable.\n- **Test data generation**: use `Bogus` for deterministic random data, `AutoFixture` for automating object creation.\n\n### Decision Tree (Complex Scenarios)\n\n```text\nQ1: External I\u002FO (DB, HTTP, filesystem, network)?\n  → Yes → Q2\n  → No  → Pure unit test, no mocks needed\n\nQ2: Mockable (interface, constructor DI)?\n  → Yes → Mock at boundary (NSubstitute.Substitute.For\u003CT>)\n  → No  → Q3\n\nQ3: Needs real behavior (SQL, HTTP pipeline)?\n  → Yes → WebApplicationFactory \u002F Testcontainers.DotNet\n  → No  → Use fake\u002Fstub implementation\n\nQ4: Async (Task, ValueTask, async\u002Fawait)?\n  → Yes → async Task test method, never async void\n  → No  → Synchronous [Fact]\u002F[Theory]\n\nQ5: Need test data with specific properties?\n  → Yes → Bogus Faker\u003CT> for deterministic random data\n  → No  → Standard xUnit test\n```\n\n### Phase 3: Test Case Design\nApply systematic test design before coding:\n1. **Happy path**: normal input → expected output.\n2. **Boundary values**: empty collections, `null`, `default(T)`, `string.Empty`, `DateTime.MinValue`.\n3. **Error cases**: exceptions (`Assert.Throws`), validation errors, 4xx\u002F5xx responses, timeout scenarios.\n4. **State & async**: mutable shared state, `static` field leakage, `Task` cancellation.\n\n### Phase 4: Code Generation\nOutput tests in this exact structure:\n```\n#### Test Strategy Summary\n- [ ] Scope: Unit \u002F Integration \u002F E2E\n- [ ] Framework: xUnit + NSubstitute (preferred) \u002F Moq (legacy) + FluentAssertions\n- [ ] Mocking: Yes\u002FNo — NSubstitute \u002F Moq\n- [ ] Edge cases covered: \u003Clist>\n\n#### Generated Test Code\n\u003Cfile_path>\n\u003Ccode>\n\n#### Running Commands\n```bash\ndotnet test --filter \"FullyQualifiedName~ClassName\"\ndotnet test --logger \"console;verbosity=detailed\"\n```\n\n#### Coverage Impact (if applicable)\n- Estimated coverage change: \u003CX%>\n- Command to verify: `dotnet test --collect:\"XPlat Code Coverage\"`\n```\n\n### Phase 5: Verification Checklist\nBefore completing, verify:\n- [ ] Tests compile and pass (`dotnet test`).\n- [ ] Each test has exactly one logical assertion focus (use `Assert.Multiple` or FluentAssertions chaining).\n- [ ] Mocks are reset between tests (reconstruct in constructor or `Dispose`).\n- [ ] No `Thread.Sleep` used for synchronization (use `Task.Delay` with `CancellationToken`).\n- [ ] Flaky test guardrails applied (`IClassFixture\u003CT>`, deterministic data, no test ordering dependencies).\n\n## TDD Workflow\n\nFollow the RED → GREEN → REFACTOR loop:\n\n1. **RED**: write a failing test that captures the new behavior\n2. **GREEN**: implement the smallest change to pass\n3. **REFACTOR**: clean up while tests stay green\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FAddTest.cs\npublic class AddTest\n{\n    [Fact] \u002F\u002F RED\n    public void Adds_Two_Numbers()\n    {\n        Assert.Equal(5, Add.AddNumbers(2, 3));\n    }\n}\n\n\u002F\u002F src\u002FMyApp\u002FAdd.cs\npublic static class Add { \u002F\u002F GREEN\n    public static int AddNumbers(int a, int b) => a + b;\n}\n\n\u002F\u002F REFACTOR: simplify\u002Frename once tests pass\n```\n\n## Code Examples\n\n### Basic Unit Test (xUnit)\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FCalculatorTest.cs\npublic class CalculatorTest\n{\n    [Fact]\n    public void Adds_Two_Numbers()\n    {\n        var result = Calculator.Add(2, 3);\n        Assert.Equal(5, result);\n    }\n}\n```\n\n### Shared Context (xUnit IClassFixture)\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FUserStoreTest.cs\npublic class UserStoreTest : IClassFixture\u003CUserStoreFixture>\n{\n    private readonly UserStore _store;\n\n    public UserStoreTest(UserStoreFixture fixture)\n    {\n        _store = fixture.Store;\n    }\n\n    [Fact]\n    public void Finds_Existing_User()\n    {\n        var user = _store.Find(\"alice\");\n        Assert.NotNull(user);\n        Assert.Equal(\"alice\", user.Name);\n    }\n}\n\npublic class UserStoreFixture : IDisposable\n{\n    public UserStore Store { get; }\n\n    public UserStoreFixture()\n    {\n        Store = new UserStore();\n        Store.Seed([new User(\"alice\"), new User(\"bob\")]);\n    }\n\n    public void Dispose() { \u002F* cleanup *\u002F }\n}\n```\n\n### Mocking (NSubstitute — Recommended)\n\n> **Prefer NSubstitute for new projects.** Moq 4.20+ introduced the controversial SponsorLink feature which raises privacy concerns in the .NET community. NSubstitute offers a cleaner, more discoverable API without external network calls during build.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FNotifierTest.cs\nusing NSubstitute;\n\npublic class NotifierTest\n{\n    [Fact]\n    public void Sends_Notifications()\n    {\n        var notifier = Substitute.For\u003CINotifier>();\n        var service = new Service(notifier);\n\n        service.Publish(\"hello\");\n\n        notifier.Received(1).Send(\"hello\");\n    }\n}\n```\n\n### Mocking (Moq — Legacy Only)\n\n> **Use only for existing codebases already committed to Moq.** For greenfield projects, choose NSubstitute.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FNotifierTest.cs\nusing Moq;\n\npublic class NotifierTest\n{\n    [Fact]\n    public void Sends_Notifications()\n    {\n        var notifier = new Mock\u003CINotifier>();\n        var service = new Service(notifier.Object);\n\n        service.Publish(\"hello\");\n\n        notifier.Verify(n => n.Send(\"hello\"), Times.Once);\n    }\n}\n```\n\n### Theory (Parametrized Test)\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FMathTest.cs\npublic class MathTest\n{\n    [Theory]\n    [InlineData(1, 2, 3)]\n    [InlineData(-1, 1, 0)]\n    [InlineData(0, 0, 0)]\n    [InlineData(100, 200, 300)]\n    public void Adds_Numbers(int a, int b, int expected)\n    {\n        Assert.Equal(expected, Math.Add(a, b));\n    }\n}\n```\n\n### Async Test\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FApiTest.cs\npublic class ApiTest\n{\n    [Fact]\n    public async Task Fetches_User_Data()\n    {\n        var user = await FetchUser(\"1\");\n        Assert.Equal(\"alice\", user.Name);\n    }\n\n    [Fact]\n    public async Task Handles_Errors()\n    {\n        await Assert.ThrowsAsync\u003CArgumentException>(() => FetchUser(\"invalid\"));\n    }\n}\n```\n\n### Exception Testing\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FValidationTest.cs\npublic class ValidationTest\n{\n    [Fact]\n    public void Throws_On_Negative_Age()\n    {\n        var ex = Assert.Throws\u003CArgumentException>(() => Validator.ValidateAge(-1));\n        Assert.Contains(\"non-negative\", ex.Message);\n    }\n}\n```\n\n### Fluent Assertions\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FUserTest.cs\nusing FluentAssertions;\n\npublic class UserTest\n{\n    [Fact]\n    public void User_Has_Correct_Properties()\n    {\n        var user = new User(\"alice\", \"alice@example.com\");\n\n        user.Name.Should().Be(\"alice\");\n        user.Email.Should().EndWith(\"@example.com\");\n        user.Roles.Should().Contain(\"user\");\n    }\n}\n```\n\n### ASP.NET Core Controller Test\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FUsersControllerTest.cs\nusing Microsoft.AspNetCore.Mvc;\nusing Moq;\n\npublic class UsersControllerTest\n{\n    [Fact]\n    public async Task Get_Returns_User()\n    {\n        var service = new Mock\u003CIUserService>();\n        service.Setup(s => s.GetUser(\"1\"))\n            .ReturnsAsync(new User(\"alice\", \"alice@example.com\"));\n\n        var controller = new UsersController(service.Object);\n        var result = await controller.Get(\"1\");\n\n        var okResult = Assert.IsType\u003COkObjectResult>(result);\n        var user = Assert.IsType\u003CUser>(okResult.Value);\n        Assert.Equal(\"alice\", user.Name);\n    }\n}\n```\n\n## Project Configuration\n\n```xml\n\u003C!-- tests\u002FUnitTests\u002FUnitTests.csproj -->\n\u003CProject Sdk=\"Microsoft.NET.Sdk\">\n  \u003CPropertyGroup>\n    \u003CTargetFramework>net8.0\u003C\u002FTargetFramework>\n    \u003CImplicitUsings>enable\u003C\u002FImplicitUsings>\n    \u003CNullable>enable\u003C\u002FNullable>\n    \u003CIsPackable>false\u003C\u002FIsPackable>\n    \u003CIsTestProject>true\u003C\u002FIsTestProject>\n  \u003C\u002FPropertyGroup>\n\n  \u003CItemGroup>\n    \u003CPackageReference Include=\"xunit\" Version=\"2.9.0\" \u002F>\n    \u003CPackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.8.0\" \u002F>\n    \u003CPackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.11.0\" \u002F>\n    \u003CPackageReference Include=\"NSubstitute\" Version=\"5.3.0\" \u002F>\n    \u003CPackageReference Include=\"FluentAssertions\" Version=\"8.0.0\" \u002F>\n    \u003CPackageReference Include=\"Bogus\" Version=\"35.6.0\" \u002F>\n    \u003CPackageReference Include=\"AutoFixture\" Version=\"5.0.0\" \u002F>\n    \u003CPackageReference Include=\"coverlet.collector\" Version=\"6.0.0\" \u002F>\n  \u003C\u002FItemGroup>\n\u003C\u002FProject>\n```\n\n## Running Tests\n\n```bash\ndotnet test                              # all test projects\ndotnet test --filter \"Category=Unit\"     # filtered by trait\ndotnet test --filter \"FullyQualifiedName~CalculatorTest\"\ndotnet test tests\u002FUnitTests              # specific project\ndotnet test --logger \"console;verbosity=detailed\"\ndotnet test --collect:\"XPlat Code Coverage\"\n```\n\n## Coverage\n\n```bash\n# Using coverlet (built-in)\ndotnet test --collect:\"XPlat Code Coverage\"\ndotnet tool install -g dotnet-reportgenerator-globaltool\nreportgenerator -reports:\"**\u002FTestResults\u002F**\u002Fcoverage.cobertura.xml\" \\\n    -targetdir:coverage -reporttypes:Html\n```\n\n```xml\n\u003C!-- Directory.Build.props (project-wide coverage settings) -->\n\u003CProject>\n  \u003CItemGroup>\n    \u003CPackageReference Include=\"coverlet.collector\" Version=\"6.0.0\">\n      \u003CPrivateAssets>all\u003C\u002FPrivateAssets>\n      \u003CIncludeAssets>runtime; build; native; contentfiles; analyzers\u003C\u002FIncludeAssets>\n    \u003C\u002FPackageReference>\n  \u003C\u002FItemGroup>\n\u003C\u002FProject>\n```\n\n## Debugging Failures\n\n1. Re-run with `-v d` (detailed verbosity) for full output.\n2. Add `Debugger.Launch()` to enter the debugger on failure.\n3. Use `ITestOutputHelper` for structured test output.\n4. Use `dotnet test --filter` to isolate the failing test.\n5. Expand to full suite once the root cause is fixed.\n\n```csharp\npublic class DebugTest\n{\n    private readonly ITestOutputHelper _output;\n\n    public DebugTest(ITestOutputHelper output)\n    {\n        _output = output;\n    }\n\n    [Fact]\n    public void With_Debug_Output()\n    {\n        _output.WriteLine(\"Debug info: {0}\", someVariable);\n        \u002F\u002F ...\n    }\n}\n```\n\n## CI\u002FCD Integration (GitHub Actions)\n\n```yaml\n# .github\u002Fworkflows\u002Ftest.yml\nname: Test\non: [push, pull_request]\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-dotnet@v4\n        with: { dotnet-version: '8.0.x' }\n      - run: dotnet test --collect:\"XPlat Code Coverage\" --logger:\"junit;LogFilePath=report.xml\"\n      - uses: actions\u002Fupload-artifact@v4\n        if: always()\n        with: { name: test-results, path: '**\u002Freport.xml' }\n```\n\n## Flaky Tests Guardrails\n\n- Never use `Thread.Sleep` for synchronization; use `Task.Delay` with `CancellationToken`.\n- Make temp directories unique with `Path.GetTempPath()` + `Guid.NewGuid()`.\n- Avoid real time, network, or filesystem dependencies in unit tests.\n- Use `ITestOutputHelper` to capture diagnostics without global state.\n- Reset static state in `IClassFixture\u003CT>.Dispose` or constructor.\n\n## Test Case Design Patterns\n\nApply these systematic patterns before writing test code to ensure robust coverage beyond the happy path.\n\n### 1. Boundary Value Analysis\nTest at the edges of valid input domains: empty, zero, maximum, null, and just-outside valid ranges.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FValidatorTest.cs\npublic class ValidatorTest\n{\n    [Theory]\n    [InlineData(\"\")]\n    [InlineData(\" \")]\n    [InlineData(\"toolonginputexceedingmaxallowedlength\")]\n    public void Rejects_Invalid_Input(string input)\n    {\n        Assert.Throws\u003CArgumentException>(() => _validator.Validate(input));\n    }\n}\n```\n\n### 2. Negative \u002F Error Case Testing\nVerify the system behaves correctly under invalid or unexpected conditions.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FCalculatorTest.cs\npublic class CalculatorTest\n{\n    [Fact]\n    public void Throws_On_Divide_By_Zero()\n    {\n        Assert.Throws\u003CDivideByZeroException>(() => _calculator.Divide(10, 0));\n    }\n}\n```\n\n### 3. State-Based Testing\nFor objects with internal state, verify transitions between states are correct and irreversible where expected.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FConnectionTest.cs\npublic class ConnectionTest\n{\n    [Fact]\n    public void State_Transitions_Are_Correct()\n    {\n        var conn = new Connection();\n        Assert.Equal(State.Closed, conn.State);\n        conn.Open();\n        Assert.Equal(State.Open, conn.State);\n        conn.Close();\n        Assert.Equal(State.Closed, conn.State);\n        \u002F\u002F Idempotency\n        conn.Close();\n        Assert.Equal(State.Closed, conn.State);\n    }\n}\n```\n\n## Common Test Smells to Avoid\n\n- **Assertion Roulette**: Many assertions without descriptive messages, making failure diagnosis ambiguous. *Fix: Use FluentAssertions chaining or `Assert.Multiple` with descriptive labels.*\n- **Happy Path Bias**: Only testing successful scenarios, leaving error paths uncovered. *Fix: Test `null` values, `ArgumentNullException`, invalid enum values, boundary conditions.*\n- **Mock Overdose**: Too many mocks hiding integration issues or coupling tests to implementation. *Fix: Mock only at architectural boundaries (IHttpClientFactory, DbContext); use `WebApplicationFactory` for integration.*\n- **The Free Ride**: Tests that execute code but assert nothing meaningful. *Fix: Every test must have at least one specific, falsifiable assertion.*\n- **Obscure Test**: Long test methods with no clear arrange\u002Fact\u002Fassert structure. *Fix: Follow AAA, use `IClassFixture\u003CT>` for shared setup, keep test bodies short.*\n- **Flaky Test**: Non-deterministic results from time, order, or shared state. *Fix: Use `TimeProvider` (NET 8+), `Bogus` with fixed seeds, `IClassFixture\u003CT>` for isolation.*\n\n## Best Practices\n\n### DO\n\n- Keep tests deterministic and isolated\n- Use constructor injection for testable components\n- Use `[Theory]` with `[InlineData]` for parametrized tests\n- Separate unit vs integration tests in separate projects\n- Use `FluentAssertions` for readable, chainable assertions\n- **Use `NSubstitute` for new projects** — cleaner API, no SponsorLink concerns\n- Follow Arrange-Act-Assert pattern with clear spacing\n- Use `IClassFixture\u003CT>` for shared test context\n\n### DON'T\n\n- Don't use `Thread.Sleep` for synchronization\n- Don't depend on real time, network, or database in unit tests\n- Don't test private methods directly — test through public API\n- Don't mock value objects, DTOs, or simple data containers\n- **Don't choose Moq for new projects** — prefer NSubstitute to avoid SponsorLink\n- Don't use `[Fact]` when `[Theory]` is appropriate\n- Don't write tests that depend on test execution order\n\n### Common Pitfalls\n\n- **Leaking static state** → Reset static state in constructor or fixture dispose.\n- **Relying on real time** → Inject `TimeProvider` (available in .NET 8+) or `ISystemClock`.\n- **Flaky async tests** → Use `async Task` return type, never `async void`.\n- **Heavy ASP.NET context** → Use `WebApplicationFactory` with in-memory `TestServer`.\n- **Over-mocking** → Prefer real implementations for domain logic and value objects.\n- **Missing coverage gates** → Add coverlet with minimum coverage thresholds in CI.\n- **Slow integration tests** → Mark with `[Trait(\"Category\", \"Integration\")]` and filter in CI.\n\n## Optional Appendix: Advanced Testing\n\n### Testcontainers (Integration Tests)\n\n```csharp\nusing Testcontainers.PostgreSql;\n\npublic class DatabaseTest : IAsyncLifetime\n{\n    private readonly PostgreSqlContainer _container =\n        new PostgreSqlBuilder().Build();\n\n    public async Task InitializeAsync() => await _container.StartAsync();\n\n    public async Task DisposeAsync() => await _container.DisposeAsync();\n\n    [Fact]\n    public async Task Connects_To_Database()\n    {\n        \u002F\u002F use _container.GetConnectionString()\n    }\n}\n```\n\n### Verify (Snapshot Testing)\n\n```csharp\n[UsesVerify]\npublic class SnapshotTest\n{\n    [Fact]\n    public Task Verifies_Output()\n    {\n        var result = SomeMethod();\n        return Verify(result);\n    }\n}\n```\n\n## Alternatives to xUnit\n\n- **NUnit**: `[SetUp]` \u002F `[TearDown]` style, broader assertion library.\n- **MSTest**: built-in Visual Studio integration, less feature-rich.\n- **SpecFlow**: BDD\u002FGherkin-style tests for .NET.\n\n### Mutation Testing (Stryker.NET)\n\n```bash\ndotnet tool install -g dotnet-stryker\ndotnet stryker --solution-path MySolution.sln --project-file=src\u002FMyProject\u002FMyProject.csproj\n# Report: StrykerOutput\u002F*\u002Freports\u002Fmutation-report.html\n```\n\n> Mutation testing introduces small code changes (e.g., `>` → `>=`) to verify tests catch them. **Target ≥80% mutation score** for business logic.\n","# C# Testing (Agent Skill)\n\nAgent-focused testing workflow for modern C# (.NET 8+) using xUnit.net with NSubstitute (preferred) \u002F Moq (legacy) and FluentAssertions.\n\n## When to Use\n\n- Writing new C# tests or fixing existing tests\n- Designing unit\u002Fintegration test coverage for C# components\n- Adding test coverage, CI gating, or regression protection\n- Configuring xUnit \u002F NSubstitute \u002F Bogus workflows for consistent execution\n- Investigating test failures or flaky behavior\n- Testing ASP.NET Core, Blazor, or library code\n\n### When NOT to Use\n\n- Implementing new product features without test changes\n- Large-scale refactors unrelated to test coverage or failures\n- Performance tuning without test regressions to validate\n- Non-C# projects or non-test tasks\n\n### Stop Conditions — When to ASK instead of generating\n\nBefore generating any test code, STOP and ask the user if:\n- The code under test has **zero testability** (static methods everywhere, no DI, hard-coded `new HttpClient()`)\n- **No test framework** is detected (no xUnit\u002FNUnit in csproj, no `dotnet test` configuration)\n- The request is **ambiguous**: \"test my app\" or \"add tests\" without specifying files or classes\n- A **required test dependency** (xUnit, NSubstitute, FluentAssertions) is not installed\n- The test would require **secrets, real credentials, or production database access**\n\n## Core Concepts\n\n- **TDD loop**: red → green → refactor (tests first, minimal fix, then cleanups).\n- **Isolation**: prefer constructor injection and mocks over global state.\n- **Test layout**: `tests\u002FUnitTests\u002F`, `tests\u002FIntegrationTests\u002F`, mirror source namespace.\n- **Facts vs Theories**: `[Fact]` for single case, `[Theory]` with `[InlineData]` \u002F `[MemberData]`.\n- **Mocks vs fakes**: Moq for interaction verification, fakes for stateful behavior.\n- **CI signal**: `dotnet test` with `--collect:\"XPlat Code Coverage\"`.\n\n## Agent Execution Protocol\n\nWhen this skill is activated, follow this exact execution sequence:\n\n### Phase 1: Context Analysis\nBefore writing any test code:\n1. Identify the .NET version (8.0+) and build tool (SDK-style csproj).\n2. Check for existing test files (`tests\u002F`, `*Test.cs`) to infer naming conventions and style.\n3. Analyze the code under test: identify public API surface, side effects, async\u002Fawait usage, and DI patterns.\n4. Determine request type: (a) new tests, (b) fixing broken tests, (c) coverage improvement, (d) flaky test diagnosis.\n\n### Phase 2: Strategy Selection\nBased on Phase 1, select the appropriate strategy:\n- **Pure functions \u002F value objects**: unit tests only, no mocks needed. Use `[Fact]` or `[Theory]`.\n- **External dependencies (DB, HTTP, filesystem)**: use **NSubstitute** (preferred) or Moq (legacy only); prefer `WebApplicationFactory` for ASP.NET Core integration tests.\n- **Async code**: use `async Task` return type, never `async void`; use `CancellationToken` where applicable.\n- **Test data generation**: use `Bogus` for deterministic random data, `AutoFixture` for automating object creation.\n\n### Decision Tree (Complex Scenarios)\n\n```text\nQ1: External I\u002FO (DB, HTTP, filesystem, network)?\n  → Yes → Q2\n  → No  → Pure unit test, no mocks needed\n\nQ2: Mockable (interface, constructor DI)?\n  → Yes → Mock at boundary (NSubstitute.Substitute.For\u003CT>)\n  → No  → Q3\n\nQ3: Needs real behavior (SQL, HTTP pipeline)?\n  → Yes → WebApplicationFactory \u002F Testcontainers.DotNet\n  → No  → Use fake\u002Fstub implementation\n\nQ4: Async (Task, ValueTask, async\u002Fawait)?\n  → Yes → async Task test method, never async void\n  → No  → Synchronous [Fact]\u002F[Theory]\n\nQ5: Need test data with specific properties?\n  → Yes → Bogus Faker\u003CT> for deterministic random data\n  → No  → Standard xUnit test\n```\n\n### Phase 3: Test Case Design\nApply systematic test design before coding:\n1. **Happy path**: normal input → expected output.\n2. **Boundary values**: empty collections, `null`, `default(T)`, `string.Empty`, `DateTime.MinValue`.\n3. **Error cases**: exceptions (`Assert.Throws`), validation errors, 4xx\u002F5xx responses, timeout scenarios.\n4. **State & async**: mutable shared state, `static` field leakage, `Task` cancellation.\n\n### Phase 4: Code Generation\nOutput tests in this exact structure:\n```\n#### Test Strategy Summary\n- [ ] Scope: Unit \u002F Integration \u002F E2E\n- [ ] Framework: xUnit + NSubstitute (preferred) \u002F Moq (legacy) + FluentAssertions\n- [ ] Mocking: Yes\u002FNo — NSubstitute \u002F Moq\n- [ ] Edge cases covered: \u003Clist>\n\n#### Generated Test Code\n\u003Cfile_path>\n\u003Ccode>\n\n#### Running Commands\n```bash\ndotnet test --filter \"FullyQualifiedName~ClassName\"\ndotnet test --logger \"console;verbosity=detailed\"\n```\n\n#### Coverage Impact (if applicable)\n- Estimated coverage change: \u003CX%>\n- Command to verify: `dotnet test --collect:\"XPlat Code Coverage\"`\n```\n\n### Phase 5: Verification Checklist\nBefore completing, verify:\n- [ ] Tests compile and pass (`dotnet test`).\n- [ ] Each test has exactly one logical assertion focus (use `Assert.Multiple` or FluentAssertions chaining).\n- [ ] Mocks are reset between tests (reconstruct in constructor or `Dispose`).\n- [ ] No `Thread.Sleep` used for synchronization (use `Task.Delay` with `CancellationToken`).\n- [ ] Flaky test guardrails applied (`IClassFixture\u003CT>`, deterministic data, no test ordering dependencies).\n\n## TDD Workflow\n\nFollow the RED → GREEN → REFACTOR loop:\n\n1. **RED**: write a failing test that captures the new behavior\n2. **GREEN**: implement the smallest change to pass\n3. **REFACTOR**: clean up while tests stay green\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FAddTest.cs\npublic class AddTest\n{\n    [Fact] \u002F\u002F RED\n    public void Adds_Two_Numbers()\n    {\n        Assert.Equal(5, Add.AddNumbers(2, 3));\n    }\n}\n\n\u002F\u002F src\u002FMyApp\u002FAdd.cs\npublic static class Add { \u002F\u002F GREEN\n    public static int AddNumbers(int a, int b) => a + b;\n}\n\n\u002F\u002F REFACTOR: simplify\u002Frename once tests pass\n```\n\n## Code Examples\n\n### Basic Unit Test (xUnit)\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FCalculatorTest.cs\npublic class CalculatorTest\n{\n    [Fact]\n    public void Adds_Two_Numbers()\n    {\n        var result = Calculator.Add(2, 3);\n        Assert.Equal(5, result);\n    }\n}\n```\n\n### Shared Context (xUnit IClassFixture)\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FUserStoreTest.cs\npublic class UserStoreTest : IClassFixture\u003CUserStoreFixture>\n{\n    private readonly UserStore _store;\n\n    public UserStoreTest(UserStoreFixture fixture)\n    {\n        _store = fixture.Store;\n    }\n\n    [Fact]\n    public void Finds_Existing_User()\n    {\n        var user = _store.Find(\"alice\");\n        Assert.NotNull(user);\n        Assert.Equal(\"alice\", user.Name);\n    }\n}\n\npublic class UserStoreFixture : IDisposable\n{\n    public UserStore Store { get; }\n\n    public UserStoreFixture()\n    {\n        Store = new UserStore();\n        Store.Seed([new User(\"alice\"), new User(\"bob\")]);\n    }\n\n    public void Dispose() { \u002F* cleanup *\u002F }\n}\n```\n\n### Mocking (NSubstitute — Recommended)\n\n> **Prefer NSubstitute for new projects.** Moq 4.20+ introduced the controversial SponsorLink feature which raises privacy concerns in the .NET community. NSubstitute offers a cleaner, more discoverable API without external network calls during build.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FNotifierTest.cs\nusing NSubstitute;\n\npublic class NotifierTest\n{\n    [Fact]\n    public void Sends_Notifications()\n    {\n        var notifier = Substitute.For\u003CINotifier>();\n        var service = new Service(notifier);\n\n        service.Publish(\"hello\");\n\n        notifier.Received(1).Send(\"hello\");\n    }\n}\n```\n\n### Mocking (Moq — Legacy Only)\n\n> **Use only for existing codebases already committed to Moq.** For greenfield projects, choose NSubstitute.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FNotifierTest.cs\nusing Moq;\n\npublic class NotifierTest\n{\n    [Fact]\n    public void Sends_Notifications()\n    {\n        var notifier = new Mock\u003CINotifier>();\n        var service = new Service(notifier.Object);\n\n        service.Publish(\"hello\");\n\n        notifier.Verify(n => n.Send(\"hello\"), Times.Once);\n    }\n}\n```\n\n### Theory (Parametrized Test)\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FMathTest.cs\npublic class MathTest\n{\n    [Theory]\n    [InlineData(1, 2, 3)]\n    [InlineData(-1, 1, 0)]\n    [InlineData(0, 0, 0)]\n    [InlineData(100, 200, 300)]\n    public void Adds_Numbers(int a, int b, int expected)\n    {\n        Assert.Equal(expected, Math.Add(a, b));\n    }\n}\n```\n\n### Async Test\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FApiTest.cs\npublic class ApiTest\n{\n    [Fact]\n    public async Task Fetches_User_Data()\n    {\n        var user = await FetchUser(\"1\");\n        Assert.Equal(\"alice\", user.Name);\n    }\n\n    [Fact]\n    public async Task Handles_Errors()\n    {\n        await Assert.ThrowsAsync\u003CArgumentException>(() => FetchUser(\"invalid\"));\n    }\n}\n```\n\n### Exception Testing\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FValidationTest.cs\npublic class ValidationTest\n{\n    [Fact]\n    public void Throws_On_Negative_Age()\n    {\n        var ex = Assert.Throws\u003CArgumentException>(() => Validator.ValidateAge(-1));\n        Assert.Contains(\"non-negative\", ex.Message);\n    }\n}\n```\n\n### Fluent Assertions\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FUserTest.cs\nusing FluentAssertions;\n\npublic class UserTest\n{\n    [Fact]\n    public void User_Has_Correct_Properties()\n    {\n        var user = new User(\"alice\", \"alice@example.com\");\n\n        user.Name.Should().Be(\"alice\");\n        user.Email.Should().EndWith(\"@example.com\");\n        user.Roles.Should().Contain(\"user\");\n    }\n}\n```\n\n### ASP.NET Core Controller Test\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FUsersControllerTest.cs\nusing Microsoft.AspNetCore.Mvc;\nusing Moq;\n\npublic class UsersControllerTest\n{\n    [Fact]\n    public async Task Get_Returns_User()\n    {\n        var service = new Mock\u003CIUserService>();\n        service.Setup(s => s.GetUser(\"1\"))\n            .ReturnsAsync(new User(\"alice\", \"alice@example.com\"));\n\n        var controller = new UsersController(service.Object);\n        var result = await controller.Get(\"1\");\n\n        var okResult = Assert.IsType\u003COkObjectResult>(result);\n        var user = Assert.IsType\u003CUser>(okResult.Value);\n        Assert.Equal(\"alice\", user.Name);\n    }\n}\n```\n\n## Project Configuration\n\n```xml\n\u003C!-- tests\u002FUnitTests\u002FUnitTests.csproj -->\n\u003CProject Sdk=\"Microsoft.NET.Sdk\">\n  \u003CPropertyGroup>\n    \u003CTargetFramework>net8.0\u003C\u002FTargetFramework>\n    \u003CImplicitUsings>enable\u003C\u002FImplicitUsings>\n    \u003CNullable>enable\u003C\u002FNullable>\n    \u003CIsPackable>false\u003C\u002FIsPackable>\n    \u003CIsTestProject>true\u003C\u002FIsTestProject>\n  \u003C\u002FPropertyGroup>\n\n  \u003CItemGroup>\n    \u003CPackageReference Include=\"xunit\" Version=\"2.9.0\" \u002F>\n    \u003CPackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.8.0\" \u002F>\n    \u003CPackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.11.0\" \u002F>\n    \u003CPackageReference Include=\"NSubstitute\" Version=\"5.3.0\" \u002F>\n    \u003CPackageReference Include=\"FluentAssertions\" Version=\"8.0.0\" \u002F>\n    \u003CPackageReference Include=\"Bogus\" Version=\"35.6.0\" \u002F>\n    \u003CPackageReference Include=\"AutoFixture\" Version=\"5.0.0\" \u002F>\n    \u003CPackageReference Include=\"coverlet.collector\" Version=\"6.0.0\" \u002F>\n  \u003C\u002FItemGroup>\n\u003C\u002FProject>\n```\n\n## Running Tests\n\n```bash\ndotnet test                              # all test projects\ndotnet test --filter \"Category=Unit\"     # filtered by trait\ndotnet test --filter \"FullyQualifiedName~CalculatorTest\"\ndotnet test tests\u002FUnitTests              # specific project\ndotnet test --logger \"console;verbosity=detailed\"\ndotnet test --collect:\"XPlat Code Coverage\"\n```\n\n## Coverage\n\n```bash\n# Using coverlet (built-in)\ndotnet test --collect:\"XPlat Code Coverage\"\ndotnet tool install -g dotnet-reportgenerator-globaltool\nreportgenerator -reports:\"**\u002FTestResults\u002F**\u002Fcoverage.cobertura.xml\" \\\n    -targetdir:coverage -reporttypes:Html\n```\n\n```xml\n\u003C!-- Directory.Build.props (project-wide coverage settings) -->\n\u003CProject>\n  \u003CItemGroup>\n    \u003CPackageReference Include=\"coverlet.collector\" Version=\"6.0.0\">\n      \u003CPrivateAssets>all\u003C\u002FPrivateAssets>\n      \u003CIncludeAssets>runtime; build; native; contentfiles; analyzers\u003C\u002FIncludeAssets>\n    \u003C\u002FPackageReference>\n  \u003C\u002FItemGroup>\n\u003C\u002FProject>\n```\n\n## Debugging Failures\n\n1. Re-run with `-v d` (detailed verbosity) for full output.\n2. Add `Debugger.Launch()` to enter the debugger on failure.\n3. Use `ITestOutputHelper` for structured test output.\n4. Use `dotnet test --filter` to isolate the failing test.\n5. Expand to full suite once the root cause is fixed.\n\n```csharp\npublic class DebugTest\n{\n    private readonly ITestOutputHelper _output;\n\n    public DebugTest(ITestOutputHelper output)\n    {\n        _output = output;\n    }\n\n    [Fact]\n    public void With_Debug_Output()\n    {\n        _output.WriteLine(\"Debug info: {0}\", someVariable);\n        \u002F\u002F ...\n    }\n}\n```\n\n## CI\u002FCD Integration (GitHub Actions)\n\n```yaml\n# .github\u002Fworkflows\u002Ftest.yml\nname: Test\non: [push, pull_request]\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-dotnet@v4\n        with: { dotnet-version: '8.0.x' }\n      - run: dotnet test --collect:\"XPlat Code Coverage\" --logger:\"junit;LogFilePath=report.xml\"\n      - uses: actions\u002Fupload-artifact@v4\n        if: always()\n        with: { name: test-results, path: '**\u002Freport.xml' }\n```\n\n## Flaky Tests Guardrails\n\n- Never use `Thread.Sleep` for synchronization; use `Task.Delay` with `CancellationToken`.\n- Make temp directories unique with `Path.GetTempPath()` + `Guid.NewGuid()`.\n- Avoid real time, network, or filesystem dependencies in unit tests.\n- Use `ITestOutputHelper` to capture diagnostics without global state.\n- Reset static state in `IClassFixture\u003CT>.Dispose` or constructor.\n\n## Test Case Design Patterns\n\nApply these systematic patterns before writing test code to ensure robust coverage beyond the happy path.\n\n### 1. Boundary Value Analysis\nTest at the edges of valid input domains: empty, zero, maximum, null, and just-outside valid ranges.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FValidatorTest.cs\npublic class ValidatorTest\n{\n    [Theory]\n    [InlineData(\"\")]\n    [InlineData(\" \")]\n    [InlineData(\"toolonginputexceedingmaxallowedlength\")]\n    public void Rejects_Invalid_Input(string input)\n    {\n        Assert.Throws\u003CArgumentException>(() => _validator.Validate(input));\n    }\n}\n```\n\n### 2. Negative \u002F Error Case Testing\nVerify the system behaves correctly under invalid or unexpected conditions.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FCalculatorTest.cs\npublic class CalculatorTest\n{\n    [Fact]\n    public void Throws_On_Divide_By_Zero()\n    {\n        Assert.Throws\u003CDivideByZeroException>(() => _calculator.Divide(10, 0));\n    }\n}\n```\n\n### 3. State-Based Testing\nFor objects with internal state, verify transitions between states are correct and irreversible where expected.\n\n```csharp\n\u002F\u002F tests\u002FUnitTests\u002FConnectionTest.cs\npublic class ConnectionTest\n{\n    [Fact]\n    public void State_Transitions_Are_Correct()\n    {\n        var conn = new Connection();\n        Assert.Equal(State.Closed, conn.State);\n        conn.Open();\n        Assert.Equal(State.Open, conn.State);\n        conn.Close();\n        Assert.Equal(State.Closed, conn.State);\n        \u002F\u002F Idempotency\n        conn.Close();\n        Assert.Equal(State.Closed, conn.State);\n    }\n}\n```\n\n## Common Test Smells to Avoid\n\n- **Assertion Roulette**: Many assertions without descriptive messages, making failure diagnosis ambiguous. *Fix: Use FluentAssertions chaining or `Assert.Multiple` with descriptive labels.*\n- **Happy Path Bias**: Only testing successful scenarios, leaving error paths uncovered. *Fix: Test `null` values, `ArgumentNullException`, invalid enum values, boundary conditions.*\n- **Mock Overdose**: Too many mocks hiding integration issues or coupling tests to implementation. *Fix: Mock only at architectural boundaries (IHttpClientFactory, DbContext); use `WebApplicationFactory` for integration.*\n- **The Free Ride**: Tests that execute code but assert nothing meaningful. *Fix: Every test must have at least one specific, falsifiable assertion.*\n- **Obscure Test**: Long test methods with no clear arrange\u002Fact\u002Fassert structure. *Fix: Follow AAA, use `IClassFixture\u003CT>` for shared setup, keep test bodies short.*\n- **Flaky Test**: Non-deterministic results from time, order, or shared state. *Fix: Use `TimeProvider` (NET 8+), `Bogus` with fixed seeds, `IClassFixture\u003CT>` for isolation.*\n\n## Best Practices\n\n### DO\n\n- Keep tests deterministic and isolated\n- Use constructor injection for testable components\n- Use `[Theory]` with `[InlineData]` for parametrized tests\n- Separate unit vs integration tests in separate projects\n- Use `FluentAssertions` for readable, chainable assertions\n- **Use `NSubstitute` for new projects** — cleaner API, no SponsorLink concerns\n- Follow Arrange-Act-Assert pattern with clear spacing\n- Use `IClassFixture\u003CT>` for shared test context\n\n### DON'T\n\n- Don't use `Thread.Sleep` for synchronization\n- Don't depend on real time, network, or database in unit tests\n- Don't test private methods directly — test through public API\n- Don't mock value objects, DTOs, or simple data containers\n- **Don't choose Moq for new projects** — prefer NSubstitute to avoid SponsorLink\n- Don't use `[Fact]` when `[Theory]` is appropriate\n- Don't write tests that depend on test execution order\n\n### Common Pitfalls\n\n- **Leaking static state** → Reset static state in constructor or fixture dispose.\n- **Relying on real time** → Inject `TimeProvider` (available in .NET 8+) or `ISystemClock`.\n- **Flaky async tests** → Use `async Task` return type, never `async void`.\n- **Heavy ASP.NET context** → Use `WebApplicationFactory` with in-memory `TestServer`.\n- **Over-mocking** → Prefer real implementations for domain logic and value objects.\n- **Missing coverage gates** → Add coverlet with minimum coverage thresholds in CI.\n- **Slow integration tests** → Mark with `[Trait(\"Category\", \"Integration\")]` and filter in CI.\n\n## Optional Appendix: Advanced Testing\n\n### Testcontainers (Integration Tests)\n\n```csharp\nusing Testcontainers.PostgreSql;\n\npublic class DatabaseTest : IAsyncLifetime\n{\n    private readonly PostgreSqlContainer _container =\n        new PostgreSqlBuilder().Build();\n\n    public async Task InitializeAsync() => await _container.StartAsync();\n\n    public async Task DisposeAsync() => await _container.DisposeAsync();\n\n    [Fact]\n    public async Task Connects_To_Database()\n    {\n        \u002F\u002F use _container.GetConnectionString()\n    }\n}\n```\n\n### Verify (Snapshot Testing)\n\n```csharp\n[UsesVerify]\npublic class SnapshotTest\n{\n    [Fact]\n    public Task Verifies_Output()\n    {\n        var result = SomeMethod();\n        return Verify(result);\n    }\n}\n```\n\n## Alternatives to xUnit\n\n- **NUnit**: `[SetUp]` \u002F `[TearDown]` style, broader assertion library.\n- **MSTest**: built-in Visual Studio integration, less feature-rich.\n- **SpecFlow**: BDD\u002FGherkin-style tests for .NET.\n\n### Mutation Testing (Stryker.NET)\n\n```bash\ndotnet tool install -g dotnet-stryker\ndotnet stryker --solution-path MySolution.sln --project-file=src\u002FMyProject\u002FMyProject.csproj\n# Report: StrykerOutput\u002F*\u002Freports\u002Fmutation-report.html\n```\n\n> Mutation testing introduces small code changes (e.g., `>` → `>=`) to verify tests catch them. **Target ≥80% mutation score** for business logic.\n",{"name":5,"metadata":24,"description":27,"compatibility":28},{"author":25,"source":26},"github-spec-kit","templates\u002Fpassive-skills\u002Fcs-testing\u002FSKILL.md","Use ONLY when user explicitly requests C# test code, xUnit\u002FNSubstitute configuration, test failure diagnosis, or coverage improvement for .NET projects.\nTriggers: \"write test c#\", \"xunit\", \"NSubstitute\", \"Bogus\", \"AutoFixture\", \"dotnet test\", \"C# coverage\", \"coverlet\", \"FluentAssertions\", \"ASP.NET test\".\nDo NOT activate for: general C# coding without test context, NuGet package restore, MSBuild\u002Fproject configuration outside test scope, or .NET runtime issues. ","Requires spec-kit project structure with .specify\u002F directory","main","021f5cbe02157229460a577e9a585f2da6d78cb0",".claude\u002Fskills\u002Fcs-testing","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck","https:\u002F\u002Fgithub.com\u002Fchenziyang110","2026-08-07 18:10:54",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add chenziyang110\u002Flaunchdeck --skill cs-testing",{"tool":41,"command":42},"bunx","bunx skills add chenziyang110\u002Flaunchdeck --skill cs-testing",{"tool":44,"command":45},"pnpm","pnpm dlx skills add chenziyang110\u002Flaunchdeck --skill cs-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcs-testing\u002FSKILL.md",true,[],[50,57,63,69,76,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7875F3HQ1GF5F6BR36KY3JE","launchdeck-agent","Codex host adapter contract fixture for Launchdeck.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fagent-hosts\u002Fcodex\u002Fskill\u002FSKILL.md",[],[],{"skillNo":58,"name":52,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7875DV2DQR33K1NFJHKAMZP","Claude host adapter contract fixture for Launchdeck.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fagent-hosts\u002Fclaude\u002Fskill\u002FSKILL.md",[],[],{"skillNo":64,"name":52,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M78759JQ7A6FQ8KDQTNYS3X9","Use this skill aggressively for local project lifecycle operations even when the user does not mention Launchdeck: start this project, run the dev server, dev, build, test, restart service, stop service, show logs, inspect ports, port is occupied, clean cache; and when the user explicitly asks to configure this local project for Launchdeck or create or generate a project-adapted `.launchdeck.yml`, including 为这个项目生成 Launchdeck 配置. Do not use for ordinary code edits, docs-only work, general explanations, API design discussion, or production deployment unless the user also asks to operate or configure a local project or service.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Fagent\u002Finstaller-payload\u002Fskill\u002Flaunchdeck-agent\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M78753ZJQ7G2CZT1W1G8WRJV","zig-testing","Use ONLY when user explicitly requests Zig test code, built-in test runner configuration,\ntest failure diagnosis, or coverage for Zig projects.\n\nTriggers: \"write test zig\", \"zig test\", \"testing.allocator\", \"zig coverage\",\n\"comptime test\", \"zig expectError\", \"zig snapshot test\", \"zig fuzz\".\n\nDo NOT activate for: general Zig coding without test context, build.zig configuration\nfor non-test targets, Zig compiler errors, or Zig build system setup.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fzig-testing\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M78750JXY4Z5D5W1EX3PQ31Z","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7874X2T83EQQFRCEY5SJJVC","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fverification-before-completion\u002FSKILL.md",[],[]]