testing-patterns

Guide .NET unit tests with AAA structure, Moq mocking, and FluentAssertions.

Updated Dec 8, 2025
One-click install
npx skills add https://github.com/Joshua-Palamuttam/claude-code-presentation --skill testing-patterns-joshua-palamuttam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/Joshua-Palamuttam/claude-code-presentation/tree/main/marketplace/plugins/dotnet-backend/skills/testing-patterns
Command: npx skills add https://github.com/Joshua-Palamuttam/claude-code-presentation --skill testing-patterns-joshua-palamuttam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams implement consistent, maintainable unit tests for .NET services using established patterns such as AAA, proper naming, and robust mocking with Moq and FluentAssertions.

Core Features & Use Cases

  • AAA pattern adoption: Standardizes Arrange-Act-Assert structure across tests.
  • Naming conventions: Clear, descriptive test method names that express scenarios and expectations.
  • Mocking with Moq: Demonstrates setup, verification, and behavior-driven tests.
  • FluentAssertions usage: Encourages readable, expressive assertions for test results.
  • Edge-case coverage: Guides tests for not-found, null, and boundary conditions.

Quick Start

Create a TaskService unit test that follows AAA, using Moq to mock dependencies and FluentAssertions for assertions.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
How do I write unit tests using the AAA pattern in .NET?

To write a unit test with Moq and FluentAssertions, you mock dependencies using Moq setups, execute the target method, and verify results using expressive FluentAssertions syntax for readable test verification.

What naming conventions should I use for xUnit test methods?

Naming conventions for xUnit test methods should use clear, descriptive names that express the specific scenario and expected behavior, making test failures immediately understandable without reading the test body.

How do I cover edge cases like null and not-found results in unit tests?

Covering edge cases like null and not-found results in unit tests requires targeted assertions using FluentAssertions to verify boundary conditions and graceful error handling for missing data scenarios.

Can I use Moq for behavior-driven testing and dependency verification in .NET?

Moq supports behavior-driven testing and dependency verification in .NET by allowing you to configure mock setups, verify method invocations, and assert that interactions with mocked dependencies match expected behaviors.