Created
October 5, 2021 08:38
-
-
Save fabioCollini/c79f9bce14c02d9b59d7bfeddcf8d6d7 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 ViewModelTest { | |
@get:Rule | |
val mainCoroutineRule = MainCoroutineRule() | |
private val viewModel by lazy { | |
CalculatorViewModel(SavedStateHandle(mutableMapOf())) | |
} | |
@Test | |
fun `sets the result when an input changes`() { | |
viewModel.v1 = "10" | |
viewModel.v2 = "20" | |
assertThat(viewModel.result).isEqualTo("30") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment