|
@@ -2,47 +2,47 @@ package ArrayListCombiner;
|
2
|
2
|
|
3
|
3
|
import Employee.Employee;
|
4
|
4
|
import Employee.Manager;
|
5
|
|
-import org.junit.Test;
|
6
|
|
-
|
7
|
5
|
import org.junit.Assert;
|
|
6
|
+import org.junit.Test;
|
8
|
7
|
|
9
|
8
|
import java.util.ArrayList;
|
10
|
9
|
|
11
|
10
|
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
|
|
-// }
|
|
11
|
+ Employee foo = new Employee("FOO", 100);
|
|
12
|
+ Manager bar = new Manager("BAR", 100);
|
|
13
|
+
|
|
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
|
47
|
|
48
|
48
|
}
|