Should I make an Arb for each one using a function...
# kotest
d
Should I make an Arb for each one using a function that takes the
entity1Id
as a parameter, or is there a better way?
s
Yes. Arb for entity2 just takes entity1 arb and can randomly choose to use one or leave null
Arb.bind might be useful
d
just takes entity1 arb
using the function param, instead of just passing an id?
fun entity2Arb(entity1: Entity1)?
s
Yeah that's good. But you need to generate the entity1 too. You could just end up with an arb that generates both
d
You mean in a Pair or some other containing data class... or just using bind on generated entity1 and entity2, and modify entity2's entity1Id in the function passed to bind?
s
Yeah a pair
d
Ok thanks!