Last active
December 22, 2021 06:36
-
-
Save cp-radhika-s/62e0742082f8871f141be35f616cce58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainViewModelTest { | |
@get:Rule | |
val mainCoroutineRule = MainCoroutineRule() | |
private val userServices = mock<UserServices>() | |
private lateinit var viewModel: MainViewModel | |
@Test | |
fun `Success state works`() = runBlocking { | |
whenever(userServices.getUsers()).thenReturn(emptyList()) | |
viewModel = MainViewModel(userServices) | |
Assert.assertEquals(State.SUCCESS(emptyList()), viewModel.state.value) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment