unit-testing

Generate xUnit unit tests for Clean Architecture command and query handlers.

69|13|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/ronnythedev/dotnet-clean-architecture-skills --skill unit-testing-ronnythedev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-testing
Source: https://github.com/ronnythedev/dotnet-clean-architecture-skills/tree/main/sample/POS/.claude/skills/21-unit-testing
Command: npx skills add https://github.com/ronnythedev/dotnet-clean-architecture-skills --skill unit-testing-ronnythedev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unit tests for command and query handlers are time-consuming to write manually; this skill generates comprehensive tests following AAA patterns to ensure reliability.

Core Features & Use Cases

  • Generates unit tests for Create/Update/Query handlers using xUnit, NSubstitute, and FluentAssertions.
  • Includes success, failure, and validation scenario templates.
  • Integrates with Clean Architecture projects to validate handlers and repository interactions.

Quick Start

To generate tests for your {Entity}, run the unit-test skill with your command and query handler scaffolds and adapt the generated templates to your domain.

Frequently Asked Questions about unit-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate unit tests for Clean Architecture command and query handlers?

To generate unit tests for Clean Architecture handlers, apply this skill to your .NET 8+ command and query scaffolds. It outputs robust test templates using xUnit, NSubstitute, and FluentAssertions, covering success, failure, and validation scenarios.

Does this unit test generation skill work with .NET 8 and xUnit?

Yes, this unit test generation skill works specifically with .NET 8 and xUnit. It combines NSubstitute for mocking dependencies and FluentAssertions to validate outcomes, ensuring tests follow the Arrange-Act-Assert structure without external I/O.

What is the best way to structure unit tests for command handlers using FluentAssertions?

The best way to structure unit tests for command handlers is using the Arrange-Act-Assert pattern. This skill generates templates that mock dependencies with NSubstitute and validate outcomes with FluentAssertions, covering success, failure, and validation scenarios.

Can I automate validation and failure scenario tests for query handlers in Clean Architecture?

Yes, you can automate validation and failure scenario tests for query handlers. This skill generates comprehensive test templates for Clean Architecture projects that explicitly cover success, failure, and validation scenarios without relying on external I/O.

How do I mock repository interactions in .NET unit tests using NSubstitute?

To mock repository interactions in .NET unit tests, this skill uses NSubstitute to configure dependency behavior. It validates repository interactions within Clean Architecture handlers, ensuring outcomes are tested without triggering external I/O operations.

Related Skills