You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get the correct player guess, use the getUnscrambledWord() function, which takes in the currentGameUiState.currentScrambledWord as an argument and returns the unscrambled word. Store this returned value in a new read-only variable named correctPlayerWord and assign the value returned by the getUnscrambledWord() function.
@test
fun gameViewModel_CorrectWordGuessed_ScoreUpdatedAndErrorFlagUnset() {
var currentGameUiState = viewModel.uiState.value
val correctPlayerWord = getUnscrambledWord(currentGameUiState.currentScrambledWord)
}
Even when I pull the full Main branch from the repository that y'all provided, it still gives an error for the getUnscrambledWord() function. It is not importing the WordsData.kt file from the test package, just the main package which doesn't have that function. The Studio suggestion for resolving it always gives a circular dependency warning.
The text was updated successfully, but these errors were encountered:
Test Strategy
https://developer.android.com/codelabs/basic-android-kotlin-compose-test-viewmodel?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-4-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-test-viewmodel#3
To get the correct player guess, use the getUnscrambledWord() function, which takes in the currentGameUiState.currentScrambledWord as an argument and returns the unscrambled word. Store this returned value in a new read-only variable named correctPlayerWord and assign the value returned by the getUnscrambledWord() function.
@test
fun gameViewModel_CorrectWordGuessed_ScoreUpdatedAndErrorFlagUnset() {
var currentGameUiState = viewModel.uiState.value
val correctPlayerWord = getUnscrambledWord(currentGameUiState.currentScrambledWord)
}
Even when I pull the full Main branch from the repository that y'all provided, it still gives an error for the getUnscrambledWord() function. It is not importing the WordsData.kt file from the test package, just the main package which doesn't have that function. The Studio suggestion for resolving it always gives a circular dependency warning.
The text was updated successfully, but these errors were encountered: