FizzBuzz { public String output(int input) { String output = ""; if (modulo(input, 3)) { output += "Fizz"; } if (modulo(input, 5)) { output += "Buzz"; } if (output.length() != 0) { return output; } return String.valueOf(input); }  String output(int input);  }
@Test public void whenWeRunItWithOneTheOutputIsTheNumber() { FizzBuzz fizzBuzz = new FizzBuzz(); assertThat(fizzBuzz.output(1)).isEqualTo("1"); }
@Test public void whenWeRunItWithTwoTheOutputIsTheNumber() { FizzBuzz fizzBuzz = new FizzBuzz(); assertThat(fizzBuzz.output(2)).isEqualTo("2"); }
@Test public void whenWeRunItWithThreeTheOutputIsTheFizz() { FizzBuzz fizzBuzz = new FizzBuzz(); assertThat(fizzBuzz.output(3)).isEqualTo("Fizz"); }
@Test public void whenWeRunItWithFiveTheOutputIsTheBuzz() { FizzBuzz fizzBuzz = new FizzBuzz(); assertThat(fizzBuzz.output(5)).isEqualTo("Buzz"); }
@Test public void whenWeRunItWithSixTheOutputIsTheFizz() { FizzBuzz fizzBuzz = new FizzBuzz(); assertThat(fizzBuzz.output(6)).isEqualTo("Fizz"); }
@Test public void whenWeRunItWithTenTheOutputIsTheBuzz() { FizzBuzz fizzBuzz = new FizzBuzz(); assertThat(fizzBuzz.output(10)).isEqualTo("Buzz"); }
@Test public void whenWeRunItWithFifteenTheOutputIsTheFizzBuzz() { FizzBuzz fizzBuzz = new FizzBuzz(); assertThat(fizzBuzz.output(15)).isEqualTo("FizzBuzz"); }
@Test public void whenWeRunItWithThirtyTheOutputIsTheFizzBuzz() { FizzBuzz fizzBuzz = new FizzBuzz(); assertThat(fizzBuzz.output(30)).isEqualTo("FizzBuzz"); }