|
@@ -1,2 +1,82 @@
|
|
1
|
+import org.junit.Test;
|
|
2
|
+import org.junit.Assert;
|
|
3
|
+
|
|
4
|
+
|
1
|
5
|
public class FizzBuzzTest {
|
|
6
|
+
|
|
7
|
+ public FizzBuzzTest() {
|
|
8
|
+ }
|
|
9
|
+ FizzBuzz FbObject = new FizzBuzz();
|
|
10
|
+
|
|
11
|
+ @Test
|
|
12
|
+ public void testFor3()
|
|
13
|
+ {
|
|
14
|
+
|
|
15
|
+ int number = 3;
|
|
16
|
+ String expected = "Fizz";
|
|
17
|
+ //when
|
|
18
|
+ String actual = FbObject.Fizz(number);
|
|
19
|
+ //then
|
|
20
|
+ Assert.assertEquals(expected, actual);
|
|
21
|
+
|
|
22
|
+ }
|
|
23
|
+
|
|
24
|
+ @Test
|
|
25
|
+ public void testFor3a()
|
|
26
|
+ {
|
|
27
|
+ int number = 2;
|
|
28
|
+ String expected = "2";
|
|
29
|
+ //when
|
|
30
|
+ String actual = FbObject.Fizz(number);
|
|
31
|
+ //then
|
|
32
|
+ Assert.assertEquals(expected, actual);
|
|
33
|
+
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+ @Test
|
|
37
|
+ public void testFor5()
|
|
38
|
+ {
|
|
39
|
+ int number = 5;
|
|
40
|
+ String expected = "Buzz";
|
|
41
|
+ //when
|
|
42
|
+ String actual = FbObject.Buzz(number);
|
|
43
|
+ //then
|
|
44
|
+ Assert.assertEquals(expected, actual);
|
|
45
|
+ }
|
|
46
|
+
|
|
47
|
+ @Test
|
|
48
|
+ public void testFor5a()
|
|
49
|
+ {
|
|
50
|
+ int number = 23;
|
|
51
|
+ String expected = "23";
|
|
52
|
+ //when
|
|
53
|
+ String actual = FbObject.Buzz(number);
|
|
54
|
+ //then
|
|
55
|
+ Assert.assertEquals(expected, actual);
|
|
56
|
+
|
|
57
|
+ }
|
|
58
|
+
|
|
59
|
+ @Test
|
|
60
|
+ public void testBoth()
|
|
61
|
+ {
|
|
62
|
+ int number = 15;
|
|
63
|
+ String expected = "FizzBuzz";
|
|
64
|
+ //when
|
|
65
|
+ String actual = FbObject.FizzBuzzOf(number);
|
|
66
|
+ //then
|
|
67
|
+ Assert.assertEquals(expected,actual);
|
|
68
|
+ }
|
|
69
|
+
|
|
70
|
+ @Test
|
|
71
|
+ public void testBothA()
|
|
72
|
+ {
|
|
73
|
+ int number = 91;
|
|
74
|
+ String expected = "91";
|
|
75
|
+ //when
|
|
76
|
+ String actual = FbObject.FizzBuzzOf(number);
|
|
77
|
+ //then
|
|
78
|
+ Assert.assertEquals(expected, actual);
|
|
79
|
+
|
|
80
|
+ }
|
|
81
|
+
|
2
|
82
|
}
|