Simple Test Driven Development Kata
For a given number return:
- “Fizz” if the number is divisible by 3
- “Buzz” if the number is divisible by 5
- “FizzBuzz” if the number is divisible by 3 and 5
- The number if no other requirement is fulfilled
- Write a method, which, given a number, returns the correct word according to the rules
- Solve the problem using TDD.
- Try to avoid using if-else chains.
- Try the extended rules.
- Try the super extended rules.
For a given number return:
- “Fizz” if the number is divisible by 3 or contains digit 3
- “Buzz” if the number is divisible by 5 or contains digit 5
- “FizzBuzz” if the number is divisible by 3 and 5, or contains digits 3 or 5
- The number if no other requirement is fulfilled
For a given number return:
- “Fizz” if the number is divisible by 3 or contains digit 3
- “Buzz” if the number is divisible by 5 or contains digit 5
- “Wozz” if the number is divisible by 7 or contains digit 7
- “FizzBuzz” if the number is divisible by 3 and 5, or contains digits 3 or 5
- “FizzWozz” if the number is divisible by 3 and 7, or contains digits 3 or 7
- “BuzzWozz” if the number is divisible by 5 and 7, or contains digits 5 or 7
- “FizzBuzzWozz” if the number is divisible by 3, 5 and 7, or contains digits 3, 5 or 7
- The number if no other requirement is fulfilled