Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Android Model-View-Intent with Unit Tests - FeedViewTest.kt Mocks
class FeedViewTest(
val testCoroutineDispatcher: TestCoroutineDispatcher,
val testCoroutineScope: TestCoroutineScope
) {
private fun FeedViewTestCaseStream() = feedViewTestCaseStream()
private lateinit var test: FeedViewTestCase
private val repository = mockkClass(FeedRepository::class)
fun `FeedView`(feedViewTestCase: FeedViewTestCase) = testCoroutineDispatcher.runBlockingTest {
test = feedViewTestCase
val viewModel = FeedViewModel(
coroutineScopeProvider = testCoroutineScope,
repository = repository
private fun mockComponents(test: FeedViewTestCase) {
coEvery {
repository.getMainFeedNetwork(any(), any())
} returns mockGetMainFeedList(test.status, test.mockFeedList)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment