|
@@ -1,7 +1,5 @@
|
1
|
1
|
package rocks.zipcode.io.quiz3.generics.arrayutility.integer;
|
2
|
2
|
|
3
|
|
-import org.junit.Test;
|
4
|
|
-import rocks.zipcode.io.quiz3.TestUtils;
|
5
|
3
|
import rocks.zipcode.io.quiz3.generics.ArrayUtility;
|
6
|
4
|
|
7
|
5
|
import java.util.function.Function;
|
|
@@ -10,7 +8,7 @@ import java.util.function.Function;
|
10
|
8
|
* @author leon on 09/12/2018.
|
11
|
9
|
*/
|
12
|
10
|
public class IntegerFilterTest {
|
13
|
|
- @Test
|
|
11
|
+
|
14
|
12
|
public void test1() {
|
15
|
13
|
// given
|
16
|
14
|
Integer[] array = new Integer[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
|
@@ -22,10 +20,10 @@ public class IntegerFilterTest {
|
22
|
20
|
Integer[] actual = utility.filter(predicate);
|
23
|
21
|
|
24
|
22
|
// then
|
25
|
|
- TestUtils.assertArrayEquals(expected, actual);
|
|
23
|
+ compare(expected, actual);
|
26
|
24
|
}
|
27
|
25
|
|
28
|
|
- @Test
|
|
26
|
+
|
29
|
27
|
public void test2() {
|
30
|
28
|
// given
|
31
|
29
|
Integer[] array = new Integer[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
|
@@ -37,10 +35,10 @@ public class IntegerFilterTest {
|
37
|
35
|
Integer[] actual = utility.filter(predicate);
|
38
|
36
|
|
39
|
37
|
// then
|
40
|
|
- TestUtils.assertArrayEquals(expected, actual);
|
|
38
|
+ compare(expected, actual);
|
41
|
39
|
}
|
42
|
40
|
|
43
|
|
- @Test
|
|
41
|
+
|
44
|
42
|
public void test3() {
|
45
|
43
|
// given
|
46
|
44
|
Integer[] array = new Integer[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
|
@@ -52,10 +50,10 @@ public class IntegerFilterTest {
|
52
|
50
|
Integer[] actual = utility.filter(predicate);
|
53
|
51
|
|
54
|
52
|
// then
|
55
|
|
- TestUtils.assertArrayEquals(expected, actual);
|
|
53
|
+ compare(expected, actual);
|
56
|
54
|
}
|
57
|
55
|
|
58
|
|
- @Test
|
|
56
|
+
|
59
|
57
|
public void test4() {
|
60
|
58
|
// given
|
61
|
59
|
Integer[] array = new Integer[]{10, 15, 20, 25, 55, 100, 150, 300, 900, 1000};
|
|
@@ -67,10 +65,10 @@ public class IntegerFilterTest {
|
67
|
65
|
Integer[] actual = utility.filter(predicate);
|
68
|
66
|
|
69
|
67
|
// then
|
70
|
|
- TestUtils.assertArrayEquals(expected, actual);
|
|
68
|
+ compare(expected, actual);
|
71
|
69
|
}
|
72
|
70
|
|
73
|
|
- @Test
|
|
71
|
+
|
74
|
72
|
public void test5() {
|
75
|
73
|
// given
|
76
|
74
|
Integer[] array = new Integer[]{10, 15, 20, 25, 55, 100, 150, 300, 900, 1000};
|
|
@@ -82,6 +80,10 @@ public class IntegerFilterTest {
|
82
|
80
|
Integer[] actual = utility.filter(predicate);
|
83
|
81
|
|
84
|
82
|
// then
|
85
|
|
- TestUtils.assertArrayEquals(expected, actual);
|
|
83
|
+ compare(expected, actual);
|
|
84
|
+ }
|
|
85
|
+
|
|
86
|
+ private void compare(Integer[] expected, Integer[] actual) {
|
|
87
|
+// TestUtils.assertArrayEquals(expected, actual);
|
86
|
88
|
}
|
87
|
89
|
}
|