write-unit-tests

Generate NUnit unit tests for C#/.NET projects with FakeItEasy and FakeXrmEasy.

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/klemensms/mcp-consultant-tools --skill write-unit-tests-klemensms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-unit-tests
Source: https://github.com/klemensms/mcp-consultant-tools/tree/main/.claude/skills/write-unittests
Command: npx skills add https://github.com/klemensms/mcp-consultant-tools --skill write-unit-tests-klemensms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Unit Test Generation Prompt helps engineers automate the creation of comprehensive NUnit-based unit tests for C#/.NET projects, aligning with project-specific patterns (NUnit, FakeItEasy, FakeXrmEasy) and improving test coverage and consistency.

Core Features & Use Cases

  • Generates complete unit test files for classes and methods across domain, infrastructure, and plugins, including happy paths, edge cases, and error handling.
  • Supports NUnit with FakeItEasy for Domain/Infrastructure and FakeXrmEasy for Dataverse plugin tests; includes AAA structure guidance, test data builders, and verification patterns.
  • Use cases: when starting a new .NET project, extending test coverage, adopting project testing standards, or adding test files for existing codebases.

Quick Start

Write comprehensive unit tests following project patterns for the provided C# classes, using NUnit with FakeItEasy and FakeXrmEasy as appropriate; ensure AAA structure, coverage of scenarios, and proper verification.

Frequently Asked Questions about write-unit-tests

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

FAQPage Schema
How do I generate NUnit unit tests for C# .NET projects automatically?

You can generate NUnit unit tests for C# .NET projects automatically by applying the Skill to your classes, which creates comprehensive test files covering happy paths, edge cases, and error handling using AAA structure and mocks.

Does this unit test generation approach support Dataverse plugins with FakeXrmEasy?

Yes, this unit test generation approach supports Dataverse plugins by utilizing FakeXrmEasy for mocking, alongside FakeItEasy for standard domain and infrastructure repository tests in your C# .NET codebase.

What is the AAA structure used in generated C# unit tests?

The AAA structure in generated C# unit tests stands for Arrange, Act, and Assert, organizing test code to set up data, execute methods, and verify outcomes for domain services and infrastructure repositories.

Can I use this to add test coverage to an existing C# codebase?

Yes, you can use this to add test coverage to an existing C# codebase by generating test files that follow project-specific patterns, including test data builders and verification helpers for consistent testing standards.

Do I need FakeItEasy and NUnit installed before generating unit tests?

Yes, you need NUnit, FakeItEasy, and FakeXrmEasy installed in your .NET project environment, as the generated unit tests rely on these frameworks for mocking dependencies and structuring assertions.

What's the best way to write unit tests for domain services and infrastructure repositories in .NET?

The best way to write unit tests for domain services and infrastructure repositories in .NET is to generate them using project-specific patterns with FakeItEasy mocks, ensuring coverage of validation, edge cases, and error handling.