|
@@ -1,2 +1,95 @@
|
|
1
|
+import org.junit.Assert;
|
|
2
|
+import org.junit.Test;
|
|
3
|
+
|
1
|
4
|
public class FizzBuzzTest {
|
|
5
|
+
|
|
6
|
+ @Test
|
|
7
|
+ public void test01()
|
|
8
|
+ {
|
|
9
|
+ //GIVEN
|
|
10
|
+ String expected = "Fizz";
|
|
11
|
+ String actual = "";
|
|
12
|
+ int testNumber = 3;
|
|
13
|
+
|
|
14
|
+ //WEHN
|
|
15
|
+ actual = FizzBuzz.of(testNumber);
|
|
16
|
+
|
|
17
|
+ //RESULT
|
|
18
|
+ Assert.assertEquals(expected, actual);
|
|
19
|
+ }
|
|
20
|
+
|
|
21
|
+ @Test
|
|
22
|
+ public void test02()
|
|
23
|
+ {
|
|
24
|
+ //GIVEN
|
|
25
|
+ String expected = "4";
|
|
26
|
+ String actual = "";
|
|
27
|
+ int testNumber = 4;
|
|
28
|
+
|
|
29
|
+ //WEHN
|
|
30
|
+ actual = FizzBuzz.of(testNumber);
|
|
31
|
+
|
|
32
|
+ //RESULT
|
|
33
|
+ Assert.assertEquals(expected, actual);
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+ @Test
|
|
37
|
+ public void test03()
|
|
38
|
+ {
|
|
39
|
+ //GIVEN
|
|
40
|
+ String expected = "Buzz";
|
|
41
|
+ String actual = "";
|
|
42
|
+ int testNumber = 5;
|
|
43
|
+
|
|
44
|
+ //WEHN
|
|
45
|
+ actual = FizzBuzz.of(testNumber);
|
|
46
|
+
|
|
47
|
+ //RESULT
|
|
48
|
+ Assert.assertEquals(expected, actual);
|
|
49
|
+ }
|
|
50
|
+
|
|
51
|
+ @Test
|
|
52
|
+ public void test04()
|
|
53
|
+ {
|
|
54
|
+ //GIVEN
|
|
55
|
+ String expected = "4";
|
|
56
|
+ String actual = "";
|
|
57
|
+ int testNumber = 4;
|
|
58
|
+
|
|
59
|
+ //WEHN
|
|
60
|
+ actual = FizzBuzz.of(testNumber);
|
|
61
|
+
|
|
62
|
+ //RESULT
|
|
63
|
+ Assert.assertEquals(expected, actual);
|
|
64
|
+ }
|
|
65
|
+
|
|
66
|
+ @Test
|
|
67
|
+ public void test05()
|
|
68
|
+ {
|
|
69
|
+ //GIVEN
|
|
70
|
+ String expected = "FizzBuzz";
|
|
71
|
+ String actual = "";
|
|
72
|
+ int testNumber = 15;
|
|
73
|
+
|
|
74
|
+ //WEHN
|
|
75
|
+ actual = FizzBuzz.of(testNumber);
|
|
76
|
+
|
|
77
|
+ //RESULT
|
|
78
|
+ Assert.assertEquals(expected, actual);
|
|
79
|
+ }
|
|
80
|
+
|
|
81
|
+ @Test
|
|
82
|
+ public void test06()
|
|
83
|
+ {
|
|
84
|
+ //GIVEN
|
|
85
|
+ String expected = "4";
|
|
86
|
+ String actual = "";
|
|
87
|
+ int testNumber = 4;
|
|
88
|
+
|
|
89
|
+ //WEHN
|
|
90
|
+ actual = FizzBuzz.of(testNumber);
|
|
91
|
+
|
|
92
|
+ //RESULT
|
|
93
|
+ Assert.assertEquals(expected, actual);
|
|
94
|
+ }
|
2
|
95
|
}
|