|
@@ -1,2 +1,46 @@
|
|
1
|
+import org.junit.Assert;
|
|
2
|
+import org.junit.Test;
|
|
3
|
+
|
1
|
4
|
public class FizzBuzzTest {
|
|
5
|
+ FizzBuzz fb = new FizzBuzz();
|
|
6
|
+
|
|
7
|
+ @Test
|
|
8
|
+ public void testFizzBuzz_3(){
|
|
9
|
+ String actual = fb.fizzBuzz(3);
|
|
10
|
+ String expected = "Fizz";
|
|
11
|
+
|
|
12
|
+ Assert.assertEquals(expected, actual);
|
|
13
|
+ }
|
|
14
|
+
|
|
15
|
+ @Test
|
|
16
|
+ public void testFizzBuzz_5(){
|
|
17
|
+ String actual = fb.fizzBuzz(5);
|
|
18
|
+ String expected = "Buzz";
|
|
19
|
+
|
|
20
|
+ Assert.assertEquals(expected, actual);
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ @Test
|
|
24
|
+ public void testFizzBuzz_15(){
|
|
25
|
+ String actual = fb.fizzBuzz(15);
|
|
26
|
+ String expected = "FizzBuzz";
|
|
27
|
+
|
|
28
|
+ Assert.assertEquals(expected, actual);
|
|
29
|
+ }
|
|
30
|
+
|
|
31
|
+ @Test
|
|
32
|
+ public void testFizzBuzz_else1(){
|
|
33
|
+ String actual = fb.fizzBuzz(2);
|
|
34
|
+ String expected = "2";
|
|
35
|
+
|
|
36
|
+ Assert.assertEquals(expected, actual);
|
|
37
|
+ }
|
|
38
|
+
|
|
39
|
+ @Test
|
|
40
|
+ public void testFizzBuzz_else2(){
|
|
41
|
+ String actual = fb.fizzBuzz(29);
|
|
42
|
+ String expected = "29";
|
|
43
|
+
|
|
44
|
+ Assert.assertEquals(expected, actual);
|
|
45
|
+ }
|
2
|
46
|
}
|