Henning B
09/04/2019, 8:39 AMKoinTest
interface
* create the mock
* create a Koin module with the mock inside
* at setup I start Koin
The output is as follows:
[DEBUG] [Koin] instances started in 0.024431 ms
[DEBUG] [Koin] +- get 'xyz.application.LocalizationHelper'
org.koin.core.error.NoBeanDefFoundException: No definition found for 'xyz.application.LocalizationHelper' has been found. Check your module definitions.
Am I doing something wrong or isn't it possible to inject mocks that way? If not, what would be the best practice to achive what I want via Koin?
Thanks a lot!gvetri
09/04/2019, 10:34 AMsingle { MockWalletUseCase() }
to create my mock dependency. Then in my test i used private val mockWalletUseCase: MockWalletUseCase by inject()
gvetri
09/04/2019, 10:38 AMHenning B
09/04/2019, 1:37 PMgvetri
09/04/2019, 1:51 PMHenning B
09/05/2019, 1:43 PMdeclareMock
to overwrite the implemantations with mocks.
Did I see that correctly?gvetri
09/06/2019, 6:54 AM