12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class FizzBuzz.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class FizzBuzz {
-
- @Test
- public void testForFizz(){
- //When
- FizzBuzz1 fb = new FizzBuzz1();
-
- //Expected
- String equals = "Fizz";
-
- //Actual
- String actual = fb.Fizz(3);
-
- assertEquals(equals, actual);
-
- }
-
- @Test
- public void testForBuzz(){
- //When
- FizzBuzz1 fb = new FizzBuzz1();
-
- //Expected
- String equals = "Buzz";
-
- //Actual
- String actual = fb.Fizz(5);
-
- assertEquals(equals, actual);
-
- }
-
- @Test
- public void testForFizzBuzz(){
- //When
- FizzBuzz1 fb = new FizzBuzz1();
-
- //Expected
- String equals = "FizzBuzz";
-
- //Actual
- String actual = fb.Fizz(30);
-
- assertEquals(equals, actual);
-
- }
-
- @Test
- public void testForNeither(){
- //When
- FizzBuzz1 fb = new FizzBuzz1();
-
- //Expected
- String equals = "4";
-
- //Actual
- String actual = fb.Fizz(4);
-
- assertEquals(equals, actual);
-
- }
- }
|