Skip to content

Instantly share code, notes, and snippets.

@EmmanuelGuther
Last active December 18, 2021 11:16
Show Gist options
  • Select an option

  • Save EmmanuelGuther/439ccb3b17e14f87ff534013536ec6c2 to your computer and use it in GitHub Desktop.

Select an option

Save EmmanuelGuther/439ccb3b17e14f87ff534013536ec6c2 to your computer and use it in GitHub Desktop.
@Test
fun myTest() = coroutineDispatcher.runBlockingTest {
val uc = GetPicturesUseCase(MyFakeRepository())
val item = uc.invoke().first()
assert(item is ResultData.Failure)
}
class MyFakeRepository : FilesRepository {
override fun getPictures(): Flow<ResultData<String>> = flow {
emit(ResultData.Success("a"))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment