Last active
September 5, 2020 20:59
-
-
Save GianpaMX/041d4d95c619d39c481ddef863a390da to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Test | |
fun `60 seconds clock`() = coroutineRule.testDispatcher.runBlockingTest { | |
whenever(observeState.invoke()).thenReturn(flowOf(State.Pomodoro(60))) | |
viewModel = ClockViewModel( | |
observeState = observeState, | |
nextState = nextState, | |
errorChannel = errorChannel, | |
defaultDispatcher = coroutineRule.testDispatcher | |
) | |
viewModel.viewState.observeForTesting { | |
assertThat(viewModel.viewState.value?.clock).isEqualTo("1:00") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment