|
@@ -1,2 +1,53 @@
|
|
1
|
+import org.junit.Assert;
|
|
2
|
+import org.junit.Test;
|
1
|
3
|
public class FizzBuzzTest {
|
2
|
|
-}
|
|
4
|
+
|
|
5
|
+ @Test
|
|
6
|
+ public void fizzTest(){
|
|
7
|
+ //given
|
|
8
|
+ FizzBuzz testFB = new FizzBuzz();
|
|
9
|
+ int num1 = 3;
|
|
10
|
+ String expected = "Fizz";
|
|
11
|
+
|
|
12
|
+ String actual = testFB.FizzBuzz(num1);
|
|
13
|
+
|
|
14
|
+ Assert.assertEquals(expected, actual);
|
|
15
|
+ }
|
|
16
|
+
|
|
17
|
+ @Test
|
|
18
|
+ public void buzzTest(){
|
|
19
|
+ //given
|
|
20
|
+ FizzBuzz testFB = new FizzBuzz();
|
|
21
|
+ int num1 = 5;
|
|
22
|
+ String expected = "Buzz";
|
|
23
|
+
|
|
24
|
+ String actual = testFB.FizzBuzz(num1);
|
|
25
|
+
|
|
26
|
+ Assert.assertEquals(expected, actual);
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ @Test
|
|
30
|
+ public void fizzBuzzTest(){
|
|
31
|
+ //given
|
|
32
|
+ FizzBuzz testFB = new FizzBuzz();
|
|
33
|
+ int num1 = 15;
|
|
34
|
+ String expected = "FizzBuzz";
|
|
35
|
+
|
|
36
|
+ String actual = testFB.FizzBuzz(num1);
|
|
37
|
+
|
|
38
|
+ Assert.assertEquals(expected, actual);
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ @Test
|
|
42
|
+ public void elseTest(){
|
|
43
|
+ //given
|
|
44
|
+ FizzBuzz testFB = new FizzBuzz();
|
|
45
|
+ int num1 = 2;
|
|
46
|
+ String expected = "2";
|
|
47
|
+
|
|
48
|
+ String actual = testFB.FizzBuzz(num1);
|
|
49
|
+
|
|
50
|
+ Assert.assertEquals(expected, actual);
|
|
51
|
+ }
|
|
52
|
+
|
|
53
|
+}
|