bdd-dotnet

Implements BDD-style unit tests for .NET domain handlers using in-memory EF Core databases.

53|4|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/nesbo/dotnet-claude-code-skills --skill bdd-dotnet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bdd-dotnet
Source: https://github.com/nesbo/dotnet-claude-code-skills/tree/main/bdd-dotnet
Command: npx skills add https://github.com/nesbo/dotnet-claude-code-skills --skill bdd-dotnet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a clear framework for writing Behavior-Driven Development (BDD) style unit tests targeting domain handlers in .NET, using real repositories backed by an in-memory database to ensure realistic validation without mocks.

Core Features & Use Cases

  • Hybrid testing approach with real repositories and EF Core InMemory database to validate domain logic end-to-end.
  • TestDataBuilder pattern that orchestrates test data setup and reusable fixtures.
  • Fluent Aggregate Builders for constructing domain objects in a readable, expressive style.
  • Fake implementations (clocks, unit of work, services) to isolate unit under test without external dependencies.
  • Naming conventions and test structure that align with Given_When_Then semantics and Arrange-Act-Assert.

Quick Start

Install the test project, review the pattern examples in the README, create tests following the Given_When_Then naming, and run dotnet test to execute the suite.

Frequently Asked Questions about bdd-dotnet

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

FAQPage Schema
How do I write BDD-style unit tests for .NET domain handlers?

BDD-style unit tests for .NET domain handlers use Given_When_Then naming conventions with NUnit, real repositories backed by EF Core InMemory databases, and TestDataBuilder patterns to validate domain logic end-to-end without mocks or external dependencies.

Can I use EF Core InMemory for testing command and query handlers?

Yes. EF Core InMemory databases enable realistic validation of command and query handlers by providing a real repository layer that exercises domain logic, workflow transitions, and aggregate interactions without requiring external services.

What's the best way to set up test data for domain handler tests in NUnit?

Use the TestDataBuilder pattern to orchestrate reusable test fixtures and fluent Aggregate Builders to construct domain objects in a readable, expressive style that aligns with Given_When_Then semantics and Arrange-Act-Assert structure.

Do I need mocks to test domain logic with EF Core InMemory?

No. Fake implementations for clocks, unit of work, and services isolate the unit under test without mocks, while real repositories backed by EF Core InMemory validate domain logic authentically without external dependencies.

How do I structure domain handler tests to follow BDD naming conventions?

Structure tests using Given_When_Then naming conventions with Arrange-Act-Assert patterns. The framework provides naming conventions, test structure examples, and TestDataBuilder orchestration to align unit tests with BDD semantics.

Can I test workflow transitions and aggregate interactions with this approach?

Yes. The hybrid testing approach with real repositories and EF Core InMemory enables testing workflow transitions, aggregate interactions, and complex domain logic by exercising the full handler pipeline with realistic data.