gen-tests

A way to generate an xUnit test suite for a class, file, or endpoint. xUnit is a testing framework for .NET, and the generated tests cover normal behavior, failures, edge cases, and asynchronous code.

In plain words
What is it for?
Use it after writing or changing code to create unit or integration tests for validation, missing data, exceptions, cancellation, concurrency, and boundary values.
Why use it?
It helps turn the target's actual behavior into an explicit test checklist and keeps tests consistent with the project's existing conventions.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/cwoodruff/dotnet-claude-code-kit/gen-tests
Any agent
npx skills add cwoodruff/dotnet-claude-code-kit --skill gen-tests
Clone the repo
git clone --depth 1 https://github.com/cwoodruff/dotnet-claude-code-kit

Made for: Claude Code, Codex.

Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 338 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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 $0.00037 $0.00338
Opus 5 $0.00018 $0.00169
Sonnet 5 $0.00007 $0.00068
Haiku 4.5 $0.00004 $0.00034

Measured 3d ago against content hash 3d06cee6c03c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gen-tests 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 3d 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.

Origin

This is a copy

100% identical to gen-tests — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/gen-tests/SKILL.md · 23 lines

What it actually says

Generate xUnit Tests

Target: $ARGUMENTS

  1. Read the target and its dependencies before writing anything. Identify: public surface, branches, edge cases (null/empty, boundary values, cancellation, concurrency), and failure modes (not found, validation, exceptions).
  2. Enumerate the test cases first as a checklist in your response — happy paths, each failure path, each boundary — and note which are unit vs. integration.
  3. Write the tests:
    • Naming: MethodName_Scenario_ExpectedResult
    • Arrange / Act / Assert with blank-line separation
    • [Theory] + [InlineData] for parametric cases
    • Mock only at boundaries (repository interfaces, external clients); use real Core logic
    • Inject TimeProvider / fakes rather than touching real time, filesystem, or network
    • Async tests return Task, never async void
  4. Match existing test project conventions — fixture patterns, builder/mother helpers, assertion library already in use. Do not introduce a new mocking or assertion library without asking.
  5. Run the new tests (dotnet test --nologo --filter <TestClassName>) and fix failures until green.
  6. Report the coverage achieved and any behaviors you could not test without refactoring (and why).
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. 3d ago First seen · 23 lines · 37 tokens per session scan A 3d06cee6c03c

Subscribe to this mod's changes

gen-tests is a skill published in the GitHub repository cwoodruff/dotnet-claude-code-kit (2 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 338 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to gen-tests, differing in 0 lines, and is treated as a copy.