dotnet-testing-xunit

dotnet-testing-xunit is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 53 tokens per session (1,168 once invoked), scanned A, original, Apache-2.0.

A testing guide for C# and .NET services using xUnit and the repository's existing test tools. It covers unit tests, fakes, HTTP tests, database tests with PostgreSQL containers, and test-first development.

In plain words
What is it for?
Use it to test C# services, including domain objects, application services, ASP.NET Core endpoints, Entity Framework queries, PostgreSQL migrations, and time-dependent code.
Why use it?
It helps separate tests for business rules from tests that need the web host or a real database. This reduces unnecessary setup while still checking endpoint wiring, validation, and SQL where those details matter.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to test C# services, including domain objects, application services, ASP.NET Core endpoints, Entity Framework queries, PostgreSQL migrations, and time-dependent code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/dotnet-testing-xunit
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 makifbaysal/tasktrooper --skill dotnet-testing-xunit
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

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 dotnet-testing-xunit

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/dotnet-testing-xunit/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/dotnet-testing-xunit)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/dotnet-testing-xunit"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/dotnet-testing-xunit/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 dotnet-testing-xunit

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/dotnet-testing-xunit"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/dotnet-testing-xunit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,168 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.00053 $0.01168
Opus 5.5 $0.00021 $0.00467
Sonnet 5.5 $0.00011 $0.00234
Haiku 4.5 $0.00005 $0.00117

Measured 1mo ago against content hash 9829a9d090e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dotnet-testing-xunit 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 1mo 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.

catalog/agents/backend-developer/skills/dotnet-testing-xunit/SKILL.md · 80 lines

How it starts

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

.NET Testing (xUnit)

Overview

Test-first in C#, same discipline as everywhere (see tdd-workflow): write the failing test, watch it fail, minimal code to pass. This skill is the .NET mechanics for that cycle.

Core principle: unit-test the domain and services as plain C# without starting the host. Start the host (WebApplicationFactory) only where wiring, serialization, validation or SQL is what you are proving.

Test levels

Level What it covers Tools
Unit Domain entity / value object, no mocks xUnit [Fact] / [Theory]
Unit with fakes Application service, its ports faked xUnit + NSubstitute (or the repository's Moq / FakeItEasy)
Persistence Repository / DbContext queries against real Postgres Testcontainers PostgreSqlContainer + the repository's migrations
HTTP Endpoint wiring, binding, validation, ProblemDetails, auth WebApplicationFactory<Program> (Microsoft.AspNetCore.Mvc.Testing) + HttpClient

Most tests are the first two. Match the repository's framework: xUnit (v3 for new projects; v2 where the repository is on it), NUnit or MSTest — never add a second one.

Unit test with a faked port

public sealed class TaskServiceTests
{
    private readonly ITaskRepository _repo = Substitute.For<ITaskRepository>();
    private readonly FakeTimeProvider _clock = new(DateTimeOffset.Parse("2026-01-01T00:00:00Z"));
    private readonly TaskService _service;

    public TaskServiceTests() => _service = new TaskService(_repo, _clock);

    [Fact]
    public async Task Create_persists_and_returns_the_task()
    {
        var task = await _service.CreateAsync("Write the report", CancellationToken.None);

        Assert.Equal("Write the report", task.Title);
        await _repo.Received(1).AddAsync(task, Arg.Any<CancellationToken>());
    }

    [Theory]
    [InlineData("")]
    [InlineData("   ")]
    public async Task Create_rejects_a_blank_title(string title)
    {
        await Assert.ThrowsAsync<InvalidTaskTitleException>(() => _service.CreateAsync(title, CancellationToken.None));
        await _repo.DidNotReceiveWithAnyArgs().AddAsync(default!, default);
    }
}

Read the full file on GitHub · 80 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. 1mo ago First seen · 80 lines · 53 tokens per session scan A 9829a9d090e0

Subscribe to this mod's changes

dotnet-testing-xunit is a skill published in the GitHub repository makifbaysal/tasktrooper (123 stars, last pushed today), licensed Apache-2.0. It adds 53 tokens to every session and 1,168 once invoked, about $0.0002 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-10-17.

Related

dotnet-testing-xunit compared with skills from other repositories

dotnet-testing-xunit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dotnet-testing-xunitmakifbaysal/tasktrooperSkill123todayApache-2.0A53Claude Code, Codex
agent-testerruvnet/rufloSkill83ktodayMITA15Claude Code
temporal-python-testingwshobson/agentsSkill43k5d agoMITA45Claude Code
python-testingmicrosoft/agent-frameworkSkill15k13d agoMITA29Claude Code, Codex
nemo-automodel-model-onboardingNVIDIA/skillsSkill4.2k2d agoApache-2.0A33Claude Code
cuequivariance-jaxNVIDIA/skillsSkill4.2k2d agoApache-2.0A38Claude Code, Codex
cuequivariance-torchNVIDIA/skillsSkill4.2k2d agoApache-2.0A37Claude Code, Codex