Create a gist now

Instantly share code, notes, and snippets.

FizzBuzz Java JUnit test
package org.scalabound.scatdd;
import static org.junit.Assert.*;
import org.junit.Test;
import org.scalabound.scatdd.FizzBuzz;
public class FizzBuzzJUnitTest {
@Test
public void testMultipleOfThreeAndFivePrintsFizzBuzz() {
assertEquals("FizzBuzz", FizzBuzz.eval(15));
}
@Test
public void testMultipleOfThreeOnlyPrintsFizz() {
assertEquals("Fizz", FizzBuzz.eval(12));
}
@Test
public void testMultipleOfFiveOnlyPrintsBuzz() {
assertEquals("Buzz", FizzBuzz.eval(10));
}
@Test
public void testNonMulitpleOfThreeOrFivePrintsTheNumber() {
assertEquals("11", FizzBuzz.eval(11));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment