Agent skill
testing-domain
Write domain and unit tests for the widget host app. Use when testing entities, value objects, invariants, domain services, and application logic with deterministic fixtures.
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/testing/testing-domain-yosrbennagra-3sc
SKILL.md
Testing Domain
Overview
Validate domain rules and invariants without UI or infrastructure dependencies.
Focus areas
- Entity and value object behavior
- Aggregate invariants
- Domain services
- Application use cases (when pure)
Definition of done (DoD)
- New domain logic has corresponding unit tests
- Tests cover happy path + at least one edge/error case
- Tests are deterministic (no random, no DateTime.Now)
- Tests run in under 1 second each
- No infrastructure/UI dependencies in domain tests
Workflow
- Build fixtures for domain objects.
- Test invariants and edge cases.
- Keep tests fast and deterministic.
- Avoid infrastructure dependencies.
Guidance
- Use builders/factories to reduce test setup noise.
- Prefer explicit assertions over snapshots.
- Name tests after the rule being validated.
References
references/fixtures.mdfor fixture patterns.references/invariant-tests.mdfor invariant coverage.
Didn't find tool you were looking for?