https://kotlinlang.org logo
#koin
Title
# koin
t

tschuchort

07/03/2019, 2:59 PM
Does anyone here have an idea why my test doesn't work?
Copy code
class MainViewModelTest : KoinTest {

    val predictionUC by inject<PredictionUseCase>()
    val routeUC by inject<RouteInfoUseCase>()
    val vmFactory by inject<MainViewModel.Factory>()

    @Before
    fun before() {
        startKoin {
            modules(appModule)
        }

        declareMock<PredictionUseCase> {  }
        declareMock<RouteInfoUseCase> {  }
    }

    @After
    fun after() {
        stopKoin()
    }

    @Test
    fun `_`() {
        val vm = vmFactory.create(emptyList())

        vm.onFilePicked(File(""))

        verify(predictionUC).onFilePicked(File(""))
    }
}
I always get an error
no interactions with this mock
. I assume the mocks aren't getting injected