mockk

Mocking and stubbing suspend functions with MockK

Prerequisites Lets suppose that in our system we have dependency on use case with suspend method: interface ProvideCurrentUser { suspend fun execute(): UserDetails}data class UserDetails(val id: String, val name: String) This use case is responsible for resolving user currently logged in to app. We have also dependency on repository, also with suspend function getUserById: interface …

Mocking and stubbing suspend functions with MockK Read More »