testing-dotnet

testing-dotnet is a skill for Claude Code from zdanovichnick/dotnet-pilot. It costs 31 tokens per session (2,074 once invoked), scanned A, original, MIT.

A reference guide for testing .NET applications with xUnit, a .NET testing framework, including unit tests, integration tests, mocks, and test organization.

In plain words
What is it for?
Use it when writing or planning .NET tests, including API tests with WebApplicationFactory, mocked services, and architecture checks.
Why use it?
It provides consistent patterns for arranging tests and choosing between isolated tests and tests using real application components.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the dotnet-pilot plugin — 15 skills, 9 agents, 6 hooks, 1 MCP server shipped together

Good fit Use it when writing or planning .NET tests, including API tests with WebApplicationFactory, mocked services, and architecture checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zdanovichnick/dotnet-pilot/testing-dotnet
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zdanovichnick/dotnet-pilot --skill testing-dotnet
Clone the repo
git clone --depth 1 https://github.com/zdanovichnick/dotnet-pilot

Made for: Claude Code.

Or install dotnet-pilot, the plugin that ships this one along with the rest of its 15 skills, 9 agents, 6 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-dotnet

README.md
[![agentmods](https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/testing-dotnet/github.svg)](https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/testing-dotnet)
Your own site
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/testing-dotnet"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/testing-dotnet/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-dotnet

Your own site · 80×15
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/testing-dotnet"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/testing-dotnet.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,074 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.02074
Opus 5.5 $0.00012 $0.00830
Sonnet 5.5 $0.00006 $0.00415
Haiku 4.5 $0.00003 $0.00207

Measured 29d ago against content hash b9edfe04ea7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-dotnet scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 29d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/testing-dotnet/SKILL.md · 232 lines

How it starts

The opening of the file, as written. The whole thing — 232 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.NET Testing Patterns

Reference for writing and reviewing tests.

Test Organization

tests/
├── MyApp.UnitTests/           # Fast, isolated, mock dependencies
│   ├── Services/
│   │   └── UserServiceTests.cs
│   └── Domain/
│       └── UserTests.cs
├── MyApp.IntegrationTests/    # Slower, real dependencies
│   ├── Api/
│   │   └── UserEndpointTests.cs
│   └── Infrastructure/
│       └── UserRepositoryTests.cs
└── MyApp.ArchitectureTests/   # Optional: enforce architecture rules
    └── LayerDependencyTests.cs

xUnit Patterns

Test Class Setup

public class UserServiceTests
{
    private readonly IUserRepository _repo = Substitute.For<IUserRepository>();
    private readonly UserService _sut; // system under test

    public UserServiceTests()
    {
        _sut = new UserService(_repo);
    }

    [Fact]
    public async Task GetByIdAsync_WhenUserExists_ReturnsUser()
    {
        var user = new User(Guid.NewGuid(), "[email protected]");
        _repo.GetByIdAsync(user.Id, Arg.Any<CancellationToken>()).Returns(user);

        var result = await _sut.GetByIdAsync(user.Id, CancellationToken.None);

        result.Should().Be(user);
    }
}

Naming Convention

MethodName_StateUnderTest_ExpectedBehavior

[Fact]
public async Task GetByIdAsync_WhenUserExists_ReturnsUser() { }

[Fact]
public async Task GetByIdAsync_WhenUserNotFound_ReturnsNull() { }

[Theory]
[InlineData("")]
[InlineData(null)]
public async Task CreateAsync_WithInvalidEmail_ReturnsValidationError(string? email) { }

IClassFixture for Shared Setup

public class DatabaseTests : IClassFixture<DatabaseFixture>
{
    private readonly DatabaseFixture _fixture;
    public DatabaseTests(DatabaseFixture fixture) => _fixture = fixture;
}

Integration Tests with WebApplicationFactory

The factory swaps the app's database for one running in a Testcontainers container (Testcontainers.MsSql; Testcontainers.PostgreSql for Npgsql), so tests run against the same provider as production. Docker must be available where the tests run.

Read the full file on GitHub · 232 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 29d ago Changed · +60 lines · +5 tokens per session b9edfe04ea7e
  2. 1mo ago First seen · 172 lines · 26 tokens per session scan A 43a21b330af0

Subscribe to this mod's changes

testing-dotnet is a skill published in the GitHub repository zdanovichnick/dotnet-pilot (5 stars, last pushed 13d ago), licensed MIT. It adds 31 tokens to every session and 2,074 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.