albrechtroehm
02/19/2020, 4:33 PMopen class TemplateDatabase : Controller(), ITemplateDatabase {
private val templateParser : ITemplateParser by params
...
}
then normally use it like this:
fun Component.templateDatabase() = inject<TemplateDatabase>(params = mapOf("templateParser" to TemplateParser()))
and for testing i would use something like this:
internal class TemplateDatabaseTest : Component() {
val templateDatabase : ITemplateDatabase by inject<TemplateDatabase>(params = mapOf("templateParser" to MockTemplateParser()))
init {
FX.setPrimaryStage(Scope(), FxToolkit.registerPrimaryStage())
}
...
}
But now I need the inheritance of the component to be able to use inject which makes it necessary to setup this FXToolkit ... which altogether doesn't seems the right way. Any help would be appreciated.