import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * The test class FizzBuzzTest. * * @author (your name) * @version (a version number or a date) */ public class FizzBuzzTest { /** * Default constructor for test class FizzBuzzTest */ public FizzBuzzTest() { } private FizzBuzz fizzBuzz; /** * Sets up the test fixture. * * Called before every test case method. */ @Before public void setup() { fizzBuzz = new FizzBuzz(); } @Test public void fizzTest1() { //given String expected = "Fizz"; //when String actual = fizzBuzz.result(3); //then assertEquals(expected, actual); } @Test public void fizzTest2() { //given String expected = "Fizz"; //when String actual = fizzBuzz.result(9); //then assertEquals(expected, actual); } @Test public void buzzTest1() { //given String expected = "Buzz"; //when String actual = fizzBuzz.result(5); //then assertEquals(expected, actual); } @Test public void buzzTest2() { //given String expected = "Buzz"; //when String actual = fizzBuzz.result(20); //then assertEquals(expected, actual); } @Test public void fizzBuzzTest1() { //given String expected = "FizzBuzz"; //when String actual = fizzBuzz.result(15); //then assertEquals(expected, actual); } @Test public void fizzBuzzTest2() { //given String expected = "FizzBuzz"; //when String actual = fizzBuzz.result(30); //then assertEquals(expected, actual); } @Test public void numberTest() { //given String expected = "11"; //when String actual = fizzBuzz.result(11); //then assertEquals(expected, actual); } }