FizzBuzz: "FizzBuzz" Requirement
Finish the kata by building the FizzBuzz feature.
We'll cover the following
The last feature that we have to implement is the FizzBuzz feature. Let’s recap the scenarios we’ve managed so far
- Return
Fizz
if the number is divisible by3
. - Return
Buzz
if the number is divisible by5
. - Return the string representation of the number if not divisible neither by
3
nor by5
.
Now, let’s focus on what we missed to complete the kata.
FizzBuzz
scenario
We have to manage the numbers that are divisible by 3
and also by 5
. When we receive one of these numbers, we need to return the FizzBuzz
string to the caller.
The Red phase
Let’s write one test to jump into the Red phase:
Get hands-on with 1200+ tech skills courses.