Better HN
topnewbestaskshowjobs
Log inSign up

strehldev

1 karma · joined Jun 6, 2024 (2y ago) · 1 submissions

Submissions

comment 11mo ago · link · parent

This is basically how I solved this in a past codebase. I called them "builders" and for complex scenarios requiring multiple different entities I called them "scenario builders" that created multiple entities.

My rule was to randomize every property by default. The test needs to specify which property needs to have a certain value. E.g. set the address if you're testing something about the address.

So it was immediately obvious which properties a test relied on.