public
Created

FizzBuzz Java JUnit test

  • Download Gist
FizzBuzzJUnitTest.java
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
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));
}
 
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.