Handling Multiple Guesses in the Wordz Gameplay
Navigate through the process of integrating and refining the gameplay experience, focusing on submitting multiple guesses and fine-tuning API design decisions for an optimal endpoint setup.
We'll cover the following
In this lesson, we’ll test-drive the code to play the game. This involves submitting multiple guess attempts to the endpoint until a game-over response is received.
Submitting multiple guesses
We start by creating an integration test for the new /guess
route in our endpoint:
The first step is to code the Arrange step. Our domain model provides the
assess()
method for classWordz
to assess the score for a guess, along with reporting whether the game is over. To test-drive this, we set up themockWordz
stub to return a validGuessResult
object when theassess()
method is called:
Get hands-on with 1400+ tech skills courses.