Triangulating Word Selection in Wordz Using Mock Setup

Let's continue our game creation by triangulating word selection implementation in the Wordz application.

There is more work to do in our test, as we need to remove the hardcoded creation of the Game object. In this section, we will address this by triangulating the word selection logic. We design the next test to drive out the correct behavior of selecting a word at random.

Triangulating word selection

The next task is to remove the cheating that we used to make the previous test pass. We hardcoded some data when we created a Game object. We need to replace that with the correct code. This code must select a word at random from our repository of known five-letter words.

  • Add a new test to drive out the behavior of selecting a random word:

Get hands-on with 1200+ tech skills courses.