einar
09/12/2017, 1:28 PMclass MyApplication : Application(), KodeinAware {
companion object {
lateinit var context: Context
fun getAppContext(): Context {
return context
}
}
override fun onCreate() {
super.onCreate()
context = applicationContext
}
override val kodein by Kodein.lazy {
bind<SettingsRepository>() with singleton { SettingsRepository(kodein) }
bind<Authenticator>() with singleton { AuthenticatorImpl(kodein) }
bind<SharedPrefsHelper>() with singleton { SharedPrefsHelper() }
bind<UserEventDataSource>() with singleton { UserEventRepository() }
}
}
So for JUnit and Intrumentation tests respectively, what are the correct or preferred ways to use Kodein? Especially in JUnit where I want to test KodeinAware classes that access other objects through the use of Kodein