Skip to content

Instantly share code, notes, and snippets.

@kings13y
Created May 28, 2012 10:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kings13y/2818292 to your computer and use it in GitHub Desktop.
Save kings13y/2818292 to your computer and use it in GitHub Desktop.
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