Skip to main content
skill CX Codex

dotnet-xunit — Claude Code skill for xUnit v3 tests

A skill for writing xUnit v3 tests in .NET: attributes, fixtures, parallel runs, IAsyncLifetime.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add wshaddix/dotnet-skills --skill dotnet-xunit -a claude-code
Open on GitHub

What dotnet-xunit does

The skill covers how to write xUnit v3 tests: [Fact] and [Theory] attributes, IClassFixture and ICollectionFixture fixtures, parallel execution settings, IAsyncLifetime for async setup and teardown, custom assertions and xUnit analyzers. A comparison table lays out what changed from v2: the xunit.v3 package replaces xunit, IAsyncLifetime now returns ValueTask, [ClassData] takes strongly typed TheoryDataRow<T> rows, and the optional message string on Assert methods is gone.

It targets .NET 8.0 and up. Your test project has to exist already with xUnit packages referenced — scaffolding belongs to dotnet-add-testing. Moving a project off xUnit v2 hits three spots: the IAsyncLifetime return type, the [ClassData] row format, and the removed Assert messages. Worth checking before you migrate.

Testing strategy and integration tests with WebApplicationFactory or Testcontainers are out of scope; separate skills handle those.

What it helps with

  • write a parameterized test with [Theory] and [InlineData]
  • share a database connection across tests via IClassFixture
  • switch IAsyncLifetime from Task to ValueTask during a v3 migration
  • configure parallel test execution per collection
  • replace an Assert message string with a custom assertion

Example prompts for the agent

  • Write xUnit v3 tests for DiscountCalculator: a [Fact] for the exception case and a [Theory] with [InlineData]
  • Show me how to put the database connection in an IClassFixture with IAsyncLifetime
  • What changes in my tests when I move from xUnit v2 to xunit.v3?

How to install dotnet-xunit

1Skills CLI (Vercel)

npx skills add wshaddix/dotnet-skills --skill dotnet-xunit -a claude-code

2Manually: put the files in place

~/.claude/skills/dotnet-xunit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/dotnet-xunit/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about dotnet-xunit

How do I install dotnet-xunit in Claude?

Run npx skills add wshaddix/dotnet-skills --skill dotnet-xunit -a claude-code. The skill lands in ~/.claude/skills/dotnet-xunit/SKILL.md.

What does dotnet-xunit do?

It guides the agent through xUnit v3 tests: [Fact] and [Theory] attributes, fixtures, parallel execution, IAsyncLifetime, custom assertions. It also spells out the v2 differences.

What do I need before using it?

A test project with xUnit packages referenced and a .NET 8.0 baseline. The skill does not scaffold projects or add package references.

Similar skills

Everything for Testing and QA →

From the same set5

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor