Test Builder Create
Create or evolve test builders with valid defaults and fluent Com* or Sem* APIs. Use when commands, queries, DTOs, or aggregates are repeatedly constructed in tests.
joaosena190 starsApr 4, 2026 When to Use
- Repeated object construction appears across tests.
- A new command, query, DTO, or aggregate needs reusable valid defaults.
- Existing builders no longer cover updated feature inputs.
What This Skill Produces
- A focused builder with valid default values.
- Fluent override methods such as
Com* and Sem*.
Build() and optionally BuildRehydrated() when the object lifecycle requires it.
Procedure
- Inspect the target type and identify required fields and common optional fields.
- Choose defaults that represent a valid, realistic happy path.
- Implement fluent override methods for fields that vary across scenarios.
- Add
BuildRehydrated() only when rehydration is a real test need.
- Keep naming aligned with the domain vocabulary already used by the module.
- Prefer extending an existing builder over creating a parallel builder for the same concept.