Lilly
12/05/2021, 2:09 AMandroidContext
with `KoTest`/ using `checkKoinModules`:
internal class DependencyGraphTest : KoinTest, WordSpec() {
init {
"Koin" should {
"inject my components" {
checkKoinModules(moduleGroupA + moduleGroupB + module {
// mock android context ??
})
}
}
}
}
Lilly
12/07/2021, 11:05 PMinternal class DependencyGraphTest : KoinTest, WordSpec() {
init {
"Koin" should {
"inject components" {
val context: Context = mockk()
val adapter: BluetoothAdapter = mockk(relaxed = true)
every {
(context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager)
.adapter
} returns adapter
checkKoinModules {
androidContext(context)
modules(bluetoothModule)
modules(appModule)
modules(libraryModule)
}
}
}
}
}