|
@@ -15,6 +15,48 @@ public class BonusTest
|
15
|
15
|
}
|
16
|
16
|
|
17
|
17
|
@Test
|
|
18
|
+ public void testFactorialBase(){
|
|
19
|
+ //Given
|
|
20
|
+ int number = 1;
|
|
21
|
+ int expected = 1;
|
|
22
|
+
|
|
23
|
+ //When
|
|
24
|
+ int actual = bonus.factorial(number);
|
|
25
|
+
|
|
26
|
+ //Then
|
|
27
|
+ assertEquals(expected, actual);
|
|
28
|
+
|
|
29
|
+ }
|
|
30
|
+
|
|
31
|
+ @Test
|
|
32
|
+ public void testFactorialOfSmallNumber(){
|
|
33
|
+ //Given
|
|
34
|
+ int number = 3;
|
|
35
|
+ int expected = 6;
|
|
36
|
+
|
|
37
|
+ //When
|
|
38
|
+ int actual = bonus.factorial(number);
|
|
39
|
+
|
|
40
|
+ //Then
|
|
41
|
+ assertEquals(expected, actual);
|
|
42
|
+
|
|
43
|
+ }
|
|
44
|
+
|
|
45
|
+ @Test
|
|
46
|
+ public void testFactorialOfBigNumber(){
|
|
47
|
+ //Given
|
|
48
|
+ int number = 6;
|
|
49
|
+ int expected = 720;
|
|
50
|
+
|
|
51
|
+ //When
|
|
52
|
+ int actual = bonus.factorial(number);
|
|
53
|
+
|
|
54
|
+ //Then
|
|
55
|
+ assertEquals(expected, actual);
|
|
56
|
+
|
|
57
|
+ }
|
|
58
|
+
|
|
59
|
+ @Test
|
18
|
60
|
public void testAcronymBasic() {
|
19
|
61
|
//Given
|
20
|
62
|
String phrase = "Portable Network Graphics";
|
|
@@ -96,45 +138,5 @@ public class BonusTest
|
96
|
138
|
}
|
97
|
139
|
|
98
|
140
|
|
99
|
|
- @Test
|
100
|
|
- public void testFactorialOf1(){
|
101
|
|
- //Given
|
102
|
|
- int number = 1;
|
103
|
|
- int expected = 1;
|
104
|
|
-
|
105
|
|
- //When
|
106
|
|
- int actual = bonus.factorial(number);
|
107
|
|
-
|
108
|
|
- //Then
|
109
|
|
- assertEquals(expected, actual);
|
110
|
|
-
|
111
|
|
- }
|
112
|
|
-
|
113
|
|
- @Test
|
114
|
|
- public void testFactorialOfSmallNumber(){
|
115
|
|
- //Given
|
116
|
|
- int number = 3;
|
117
|
|
- int expected = 6;
|
118
|
|
-
|
119
|
|
- //When
|
120
|
|
- int actual = bonus.factorial(number);
|
121
|
|
-
|
122
|
|
- //Then
|
123
|
|
- assertEquals(expected, actual);
|
124
|
|
-
|
125
|
|
- }
|
126
|
|
-
|
127
|
|
- @Test
|
128
|
|
- public void testFactorialOfBigNumber(){
|
129
|
|
- //Given
|
130
|
|
- int number = 6;
|
131
|
|
- int expected = 720;
|
132
|
|
-
|
133
|
|
- //When
|
134
|
|
- int actual = bonus.factorial(number);
|
135
|
|
-
|
136
|
|
- //Then
|
137
|
|
- assertEquals(expected, actual);
|
138
|
|
-
|
139
|
|
- }
|
|
141
|
+
|
140
|
142
|
}
|