Handling Multiple Guess in 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 optimal endpoint setup.

In this lesson, we will 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 on class Wordz to assess the score for a guess, along with reporting whether the game is over. To test-drive this, we set up the mockWordz stub to return a valid GuessResult object when the assess() method is called:

Get hands-on with 1200+ tech skills courses.