Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Update Logic #41

Open
wants to merge 1 commit into
base: viewmodel_m2
Choose a base branch
from

Conversation

ManasMalla
Copy link

  1. On validating the last question, when we don't pick a new question, don't increment the currentWordCount. Updating the currentWordCount, the value updates to 11, where the max_number_of_questions is 10 and hence the test fails.
  2. When initializing the ViewModel and setting up the first question, increment the currentWordCount as 1, else the status shows 0 out of 10.

Then the test cases given in the codelab work out of the box.

On validating the last question, when we don't pick a new question, don't increment the currentWordCount and when initializing the ViewModel and setting up the first question, increment the currentWordCount as 1. Then the test cases given in the codelab work out of the box
@dan-scott-dev
Copy link

dan-scott-dev commented Jan 24, 2023

  1. On validating the last question, when we don't pick a new question, don't increment the currentWordCount. Updating the currentWordCount, the value updates to 11, where the max_number_of_questions is 10 and hence the test fails.
  2. When initializing the ViewModel and setting up the first question, increment the currentWordCount as 1, else the status shows 0 out of 10.

Then the test cases given in the codelab work out of the box.

I think the bug is in the test, not in the main app code.

I think the test needs to be updated to:

 // Assert that current word count is set to 0.
  assertTrue(gameUiState.currentWordCount == 0)

In section 2 (App Overview), it says that "the app displays the word count, which is the number of scrambled words played in the current game" - which to me implies that it does correctly show 0 when starting, because you haven't yet played (past tense) a word yet, and in this case I would expect it to show 9 of 10 when I'm on the last word of the game (though intuitive this may be).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants