tdd

Automate red-green-refactor cycles for .NET projects with xUnit and Moq.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/amodelandme/skill-tree-dotnet --skill tdd-amodelandme
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/amodelandme/skill-tree-dotnet/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/amodelandme/skill-tree-dotnet --skill tdd-amodelandme

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write tests before implementation to ensure correct design, clearer requirements, and safer refactors in .NET projects.

Core Features & Use Cases

  • Unit test scaffolding and guidance for domain logic, invariants, and guard clauses.
  • Integration testing guidance for HTTP endpoints using WebApplicationFactory and test doubles.
  • Database testing guidance with EF Core and TestContainers for repository validation.

Quick Start

Run the red-green-refactor loop against a .NET project to drive design.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development in .NET and how does it improve my code?

Test-driven development (TDD) in .NET means writing tests before implementation to ensure correct design, clearer requirements, and safer refactors. It validates domain logic and algorithms through structured red-green-refactor cycles.

How do I scaffold unit tests for domain logic and invariants in .NET?

Scaffold unit tests for domain logic and invariants using xUnit and FluentAssertions. This approach guides you through writing tests for guard clauses and domain rules before writing the actual implementation code.

What's the best way to set up integration testing for HTTP endpoints in .NET?

The best way to set up integration testing for HTTP endpoints in .NET is using WebApplicationFactory and test doubles. This validates your API endpoints by running tests against the actual web host in memory.

Can I use TestContainers and EF Core for database testing in .NET?

Yes, you can use TestContainers and EF Core for database testing in .NET. This combination validates your repository patterns by spinning up real database instances in containers, ensuring accurate integration testing.

How do I apply the red-green-refactor loop to fix bugs in .NET projects?

Apply the red-green-refactor loop to fix bugs by first writing a failing test that reproduces the bug, then implementing the minimal code to pass the test, and finally refactoring the design safely.

Does this TDD workflow support mocking dependencies with Moq?

Yes, this TDD workflow supports mocking dependencies with Moq. It integrates Moq alongside xUnit and FluentAssertions to isolate units of work and validate interactions during the test-driven design process.