google-developer-training / basic-android-kotlin-compose-training-unscramble

Apache License 2.0
98 stars 140 forks source link

Android Basics: Viewmodel and State with Compose #172

Open nphuoc1625 opened 9 months ago

nphuoc1625 commented 9 months ago

In Write unit tests for Viewmodels part 4, from step 6 to 7.

step 6 code use "unScrambledWord" but 7 is "correctPlayerWord "

@Test fun gameViewModel_CorrectWordGuessed_ScoreUpdatedAndErrorFlagUnset() { var currentGameUiState = viewModel.uiState.value val unScrambledWord = getUnscrambledWord(currentGameUiState.currentScrambledWord)

}

@Test fun gameViewModel_CorrectWordGuessed_ScoreUpdatedAndErrorFlagUnset() { var currentGameUiState = viewModel.uiState.value val correctPlayerWord = getUnscrambledWord(currentGameUiState.currentScrambledWord)

viewModel.updateUserGuess(correctPlayerWord)
viewModel.checkUserGuess()

}