Paolo
03/26/2020, 10:04 AMinternal val someModule = module {
scope<TheOwnerOfThings>{
scope<Scope1> {
scoped <SomeInterface>{ (param: String) -> ThisThing(param) }
}
scope<Scope2> {
scoped <SomeInterface>{ (param: String) -> ThatThing(param) }
}
}
}
How would I go about testing the creation of ThisThing
and ThatThing
? Clearly calling the following wouldn't work...
create<SomeInterface> { parametersOf("Lol") }
...since koin wouldn't know which SomeInterface
to create. And calling this would also not work...
create<ThatThing> { parametersOf("Lol") }
...since none of my definitions returns a ThatThing
type.
I figure a way to get around this would be to split Scope1
and Scope2
into separate modules, but I can't do this because I want to limit the scope of these to be within the scope of TheOwnerOfThings
.
Is there a solution to this?