# dotnet-testing-strategy

Guides assistants in choosing between unit and integration tests for .NET projects. Sets directory structures and method naming patterns.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 608 installs · ★ 86
- Author: wshaddix
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/dotnet-testing-strategy/SKILL.md
- Updated: 2026-02-27
- HTML: https://affpapa.org/en/nevibecode/skills/dotnet-testing-strategy

## What it does

The skill provides a decision tree to choose between unit and integration tests. Pure business logic belongs in fast unit tests. They run in under 10ms. When verifying database queries, it directs you toward real instances via Testcontainers instead of a mocked `DbContext`, which fails to validate actual SQL generation.

Test projects mirror production namespaces inside the `tests/` folder with suffixes like `*.UnitTests`. The skill enforces Arrange-Act-Assert blocks alongside naming conventions such as `Method_Scenario_ExpectedBehavior`. Project scaffolding and code coverage remain outside its scope. Running `dotnet-project-analysis` beforehand is required to map out the solution.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-testing-strategy -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/dotnet-testing-strategy/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/dotnet-testing-strategy/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-testing-strategy -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/dotnet-testing-strategy/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-testing-strategy -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/dotnet-testing-strategy/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install wshaddix/dotnet-skills dotnet-testing-strategy
```

2. **Manually: put the files in place**
- File: `.github/skills/dotnet-testing-strategy/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-testing-strategy -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/wshaddix/dotnet-skills --path skills/dotnet-testing-strategy
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/dotnet-testing-strategy/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-testing-strategy -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/dotnet-testing-strategy/SKILL.md

## When to use it
- pick between unit, integration, and functional test types
- organize test projects to mirror production assemblies
- standardize test method names using clear conventions
- structure test bodies into distinct Arrange, Act, and Assert steps

## Example prompts
- Follow the decision tree to pick the right test type for `OrderService.cs`.
- Suggest the project layout and class name for testing `MyApp.Infrastructure`.
- Refactor this test to follow the Arrange-Act-Assert convention.

## Similar
- [improve-codebase-architecture](https://affpapa.org/en/nevibecode/skills/improve-codebase-architecture.md) — skill · 1163035 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs
- [tdd](https://affpapa.org/en/nevibecode/skills/tdd.md) — skill · 1141062 installs
- [skill-creator](https://affpapa.org/en/nevibecode/skills/skill-creator.md) — skill · 414180 installs
- [agent-browser](https://affpapa.org/en/nevibecode/skills/vercel-labs-agent-browser.md) — skill · 1200000 installs
- [prototype](https://affpapa.org/en/nevibecode/skills/prototype.md) — skill · 986201 installs

From the same set: [wshaddix/dotnet-skills](https://affpapa.org/en/nevibecode/by/wshaddix/dotnet-skills.md) — 13 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
