application-layer-testing

Test application layer handlers with real domain objects and mocked infrastructure.

192|32|Updated May 20, 2025
One-click install
npx skills add https://github.com/SebastienDegodez/copilot-instructions --skill application-layer-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: application-layer-testing
Source: https://github.com/SebastienDegodez/copilot-instructions/tree/main/plugins/csharp-clean-architecture-development/skills/application-layer-testing
Command: npx skills add https://github.com/SebastienDegodez/copilot-instructions --skill application-layer-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) and references (resource) components.

What problem does it solve?

The Application Layer Testing skill helps teams ensure that CQRS Command and Query handlers operate correctly by using sociable testing with real domain objects and mocked infrastructure, delivering fast, maintainable tests.

Core Features & Use Cases

  • Tests Application Layer handlers with real Domain objects and mocked infrastructure to verify business logic and orchestration.
  • Promotes a sociable testing approach to validate end-to-end flows while keeping unit tests fast.
  • Use Case: Validate PlaceOrder command handling or GetOrder query handling with real domain aggregates.

Quick Start

Create sociable tests that exercise application handlers with real domain objects and mocked infrastructure, then run them with your test framework.

Frequently Asked Questions about application-layer-testing

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

FAQPage Schema
How do I test CQRS command and query handlers with real domain objects?

Test CQRS handlers by using sociable testing to exercise application layer logic with real domain aggregates while mocking infrastructure. This validates business logic and orchestration rules while keeping unit tests fast and deterministic.

What is sociable testing in domain-driven design?

Sociable testing in domain-driven design validates end-to-end application flows by exercising real domain objects together. It verifies domain invariants and business logic directly, rather than isolating every component with mocks.

How do I set up sociable tests using xUnit and FakeItEasy?

Set up sociable tests by configuring xUnit as your test framework and using FakeItEasy to mock infrastructure dependencies. This allows you to instantiate real domain aggregates and run deterministic tests against your application handlers.

Can I isolate infrastructure dependencies while testing application layer orchestration?

Yes, you can isolate infrastructure dependencies while testing application layer orchestration by mocking them. This ensures tests remain fast and deterministic while verifying that your real domain objects correctly enforce business invariants.

When should I use sociable testing instead of solitary unit tests for application layers?

Use sociable testing when you need to validate end-to-end application flows and domain invariants across commands and queries. It is ideal for verifying business logic orchestration while keeping infrastructure mocked for speed.

Does sociable testing work for validating domain invariants in a CQRS architecture?

Sociable testing works effectively for validating domain invariants in CQRS architectures by using real domain aggregates within command and query handlers. This approach verifies business logic while maintaining fast, deterministic test execution.