|
@@ -0,0 +1,48 @@
|
|
1
|
+package ArrayListCombiner;
|
|
2
|
+
|
|
3
|
+import Employee.Employee;
|
|
4
|
+import Employee.Manager;
|
|
5
|
+import org.junit.Test;
|
|
6
|
+
|
|
7
|
+import org.junit.Assert;
|
|
8
|
+
|
|
9
|
+import java.util.ArrayList;
|
|
10
|
+
|
|
11
|
+public class ArrayListCombinerTest {
|
|
12
|
+// Employee foo = new Employee("FOO", 100);
|
|
13
|
+// Manager bar = new Manager("BAR", 100);
|
|
14
|
+// @Test
|
|
15
|
+// public void testExtendCombiner() throws Exception {
|
|
16
|
+// // Given an array list with employees
|
|
17
|
+// ArrayList<Employee> first = new ArrayList<>();
|
|
18
|
+// first.add(foo);
|
|
19
|
+// // An an array list with managers
|
|
20
|
+// ArrayList<Manager> second = new ArrayList<>();
|
|
21
|
+// second.add(bar);
|
|
22
|
+// // When I combine them
|
|
23
|
+// ArrayListCombiner.extendCombiner(first, second);
|
|
24
|
+// // Then I should get an arrayList with both
|
|
25
|
+// ArrayList<Employee> expected = new ArrayList<>();
|
|
26
|
+// expected.add(foo);
|
|
27
|
+// expected.add(bar);
|
|
28
|
+// Assert.assertEquals(expected, first);
|
|
29
|
+// }
|
|
30
|
+//
|
|
31
|
+// @Test
|
|
32
|
+// public void testSuperCombiner() throws Exception {
|
|
33
|
+// // Given an array list with employees
|
|
34
|
+// ArrayList<Employee> first = new ArrayList<>();
|
|
35
|
+// first.add(foo);
|
|
36
|
+// // An an array list with managers
|
|
37
|
+// ArrayList<Manager> second = new ArrayList<>();
|
|
38
|
+// second.add(bar);
|
|
39
|
+// // When I combine them
|
|
40
|
+// ArrayListCombiner.superCombiner(first, second);
|
|
41
|
+// // Then I should get an arrayList with both
|
|
42
|
+// ArrayList<Employee> expected = new ArrayList<>();
|
|
43
|
+// expected.add(foo);
|
|
44
|
+// expected.add(bar);
|
|
45
|
+// Assert.assertEquals(expected, first);
|
|
46
|
+// }
|
|
47
|
+
|
|
48
|
+}
|