Closed milgner closed 3 months ago
Hi @milgner, inside the generator block of the factory you have access to fixture
which will use any factories already defined. So basically for your example you can simply write:
val myFixtures = kotlinFixture {
factory<MyComplexObject> { buildAComplexObject() }
factory<AnotherObject> { AnotherObject(complexStuff = fixture<MyComplexObject>()) }
}
When building complex data structures, I'd like to invoke other factories from within the current one.
Something along the lines of
Unfortunately I haven't found a way to do this with the current API except through multiple
kotlinFixture
blocks. Any ideas?