Created
January 5, 2022 03:34
-
-
Save gabrielbmoro/d393db0e5db90f354de2ad967f056785 to your computer and use it in GitHub Desktop.
Example 1 - Unit tests article
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
private val localRepository = mockk<LocalRepository>() | |
@Test | |
fun `user name - already exists a user name`() { | |
every { localRepository.userName() }.returns("Moro") | |
val viewModel = UserNameStepViewModel(localRepository) | |
val result = viewModel.userName | |
Truth.assertThat(result).isEqualTo("Moro") | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment