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 { FizzBuzz test = new FizzBuzz(); /** * Default constructor for test class FizzBuzzTest */ public FizzBuzzTest() { } /** * Sets up the test fixture. * * Called before every test case method. */ @Before public void setUp() { } @Test public void fizzbuzzTest1(){ //Given int x = 2; //When String actual = test.fizzbuzz(x); String expected = "2"; //Result assertEquals(actual, expected); } @Test public void fizzbuzzTest2(){ //Given int x = 3; //When String actual = test.fizzbuzz(x); String expected = "Fizz"; //Result assertEquals(actual, expected); } @Test public void fizzbuzzTest3(){ //Given int x = 5; //When String actual = test.fizzbuzz(x); String expected = "Buzz"; //Result assertEquals(actual, expected); } @Test public void fizzbuzzTest4(){ //Given int x = 15; //When String actual = test.fizzbuzz(x); String expected = "FizzBuzz"; //Result assertEquals(actual, expected); } /** * Tears down the test fixture. * * Called after every test case method. */ @After public void tearDown() { } }