fizzbuzz-tdd-example

This is a step-by-step guide for writing FizzBuzz with TDD in GO. You can see every step in each commit.

FizzBuzz concept

The whole concept is simple.

  • When input any number, it should return that number.
  • When input number that can divide by 3, it should return Fizz.
  • When input number that can divide by 5, it should return Buzz.
  • When input number that can divide by 3 and 5, it should return FizzBuzz.

Test case example

Input Output
1 1
2 2
3 Fizz
4 4
5 Buzz
6 Fizz
7 7
8 8
9 Fizz
10 Buzz
11 11
12 Fizz
13 13
14 14
15 FizzBuzz
... ...