|
@@ -115,4 +115,58 @@ public class ArrazTest {
|
115
|
115
|
//THEN
|
116
|
116
|
Assert.assertEquals(expected, actual);
|
117
|
117
|
}
|
|
118
|
+
|
|
119
|
+ @Test
|
|
120
|
+ public void test1containsValue(){
|
|
121
|
+ //GIVEN
|
|
122
|
+ int[] arr = {1, 2, 3, 4, 5};
|
|
123
|
+
|
|
124
|
+ //WHEN
|
|
125
|
+ int test = 3;
|
|
126
|
+ boolean expected = true;
|
|
127
|
+ boolean actual = arraz.containsValue(arr, test);
|
|
128
|
+
|
|
129
|
+ //THEN
|
|
130
|
+ Assert.assertEquals(expected, actual);
|
|
131
|
+ }
|
|
132
|
+
|
|
133
|
+ @Test
|
|
134
|
+ public void test2containsValue(){
|
|
135
|
+ //GIVEN
|
|
136
|
+ int[] arr = {1, 2, 3, 4, 5, 6};
|
|
137
|
+
|
|
138
|
+ //WHEN
|
|
139
|
+ int test = 7;
|
|
140
|
+ boolean expected = false;
|
|
141
|
+ boolean actual = arraz.containsValue(arr, test);
|
|
142
|
+
|
|
143
|
+ //THEN
|
|
144
|
+ Assert.assertEquals(expected, actual);
|
|
145
|
+ }
|
|
146
|
+
|
|
147
|
+ @Test
|
|
148
|
+ public void test1reverseArray(){
|
|
149
|
+ //GIVEN
|
|
150
|
+ int[] arr = {1, 2, 3, 4, 5};
|
|
151
|
+
|
|
152
|
+ //WHEN
|
|
153
|
+ int[] expected = {5, 4, 3, 2, 1};
|
|
154
|
+ int[] actual = arraz.reverseArray(arr);
|
|
155
|
+
|
|
156
|
+ //THEN
|
|
157
|
+ Assert.assertEquals(arr[1], actual[3]);
|
|
158
|
+ }
|
|
159
|
+
|
|
160
|
+ @Test
|
|
161
|
+ public void test2reverseArray(){
|
|
162
|
+ //GIVEN
|
|
163
|
+ int[] arr = {-2, -1, 0, 1};
|
|
164
|
+
|
|
165
|
+ //WHEN
|
|
166
|
+ int[] expected = {1, 0, -1, -2};
|
|
167
|
+ int[] actual = arraz.reverseArray(arr);
|
|
168
|
+
|
|
169
|
+ //THEN
|
|
170
|
+ Assert.assertEquals(arr[0], actual[3]);
|
|
171
|
+ }
|
118
|
172
|
}
|