Generates complete xUnit test classes for C#/.NET code with AAA structure, mocking, and edge cases. Handles single files, folders, projects, or GitHub repos.
Ships in TheCodeMan .NET AI ToolKit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write complete, compiling xUnit test classes for the supplied C# code — happy paths, edge cases, and failure cases — using AAA structure and proper mocking.
You don't need pasted snippets. Accept any scope and figure out what to test yourself:
git clone --depth 1 <url> /tmp/repo && cd /tmp/repoDiscover targets and existing coverage with Glob/Grep/Bash, e.g.:
grep -rln "public class\|public record\|public sealed class" --include=*.cs <target> | grep -vi "/obj/\|/bin/\|Tests"
ls **/*Tests.cs 2>/dev/null # what's already covered / which test stack & libs they use
Match the project's existing test stack (mocking + assertion libs) by reading a current test file rather than asking. For a folder/project, list the types you'll cover and start with the highest-value ones. Skip trivial DTOs/POCOs. Always say which files you generated tests for.
The user points at code to test — a class, a folder, a project, or a GitHub link — and wants unit tests. Default to NSubstitute + FluentAssertions, but if the project already uses Moq or built-in Assert, match it (detect from an existing test file). Only ask if there's no existing test project and the choice is genuinely ambiguous.
[Theory] with [InlineData]/[MemberData] for the same logic over many inputs instead of copy-pasted [Fact]s.MethodName_Scenario_ExpectedOutcome (e.g. PlaceOrder_WhenCustomerHasNoCredit_ReturnsFailure).// Arrange / // Act / // Assert.[Theory] data instead.public class OrderServiceTests
{
private readonly IOrderRepository _repo = Substitute.For<IOrderRepository>();
private readonly IUnitOfWork _uow = Substitute.For<IUnitOfWork>();
private readonly OrderService _sut;
public OrderServiceTests() => _sut = new OrderService(_repo, _uow);
[Fact]
public async Task PlaceOrder_WhenValid_PersistsAndReturnsId()
{
// Arrange
var cmd = new CreateOrderCommand(CustomerId: Guid.NewGuid(), Lines: new() { new("SKU1", 2) });
// Act
var result = await _sut.PlaceOrderAsync(cmd, CancellationToken.None);
// Assert
result.IsSuccess.Should().BeTrue();
await _repo.Received(1).AddAsync(Arg.Any<Order>(), Arg.Any<CancellationToken>());
await _uow.Received(1).SaveChangesAsync(Arg.Any<CancellationToken>());
}
[Theory]
[InlineData(0)]
[InlineData(-1)]
public async Task PlaceOrder_WithNonPositiveQuantity_ReturnsFailure(int qty)
{
var cmd = new CreateOrderCommand(Guid.NewGuid(), new() { new("SKU1", qty) });
var result = await _sut.PlaceOrderAsync(cmd, CancellationToken.None);
result.IsSuccess.Should().BeFalse();
await _repo.DidNotReceive().AddAsync(Arg.Any<Order>(), Arg.Any<CancellationToken>());
}
}
## Test plan
<bulleted list of the cases you'll cover and why>
## Tests
<the full compiling test class>
## Not covered here (needs integration tests)
<anything that hits real I/O — flagged, not mocked into meaninglessness>
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
xunit, unit-testing, csharp-testing, dotnet-testing, test-generation
49 skills in this plugin
/adonet-data-access-auditorAudit and fix classic ADO.NET data-access code (SqlConnection / SqlCommand / SqlDataReader / DataSet) on .NET Framework. Use this skill whenever the user shares raw ADO.NET code, a DAL / repository built on SqlCommand, stored-proc calls, string-concatenated SQL, or mentions SQL injection, parameterized queries, connection leaks, "using / Dispose", reading the same column multiple times, transactions, or "why does my old data layer leak connections / is it safe". Always use this skill for classic ADO.NET review instead of answering from memory; it applies a fixed security + correctness + performance checklist and rewrites the code./async-await-auditorAudit C#/.NET code for async/await anti-patterns and concurrency bugs. Use this skill whenever the user shares async C# code or asks about deadlocks, async void, .Result/.Wait(), blocking calls, ConfigureAwait, sync-over-async, fire-and-forget tasks, CancellationToken usage, or "why does my async code hang/deadlock". Always use this skill for async correctness/performance reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-policy-generatorDesign ASP.NET Core authorization — policy-based, role-based, and claims/requirement-based with custom authorization handlers and resource-based checks. Use this skill whenever the user wants authorization policies, role/claim checks, custom AuthorizationHandler, resource-based authorization, permission checks, or asks "how do I authorize this / policy vs role / restrict this endpoint to X". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./dotnet-ai-toolkit:xunit-test-generatorfrom TheCodeMan .NET AI ToolKit
npx claudepluginhub stefanthecode/dotnet-ai-toolkit --plugin dotnet-ai-toolkitOther plugins' skills for the same job