kotlinfixture
kotlinfixture copied to clipboard
Referencing other factories in one `kotlinFixture` block.
When building complex data structures, I'd like to invoke other factories from within the current one.
Something along the lines of
val myFixtures = kotlinFixture {
factory<MyComplexObject> { buildAComplexObject() }
factory<AnotherObject> { AnotherObject(complexStuff = buildFromPreviousFactory<MyComplexObject>()) }
}
Unfortunately I haven't found a way to do this with the current API except through multiple kotlinFixture blocks. Any ideas?