Browse Source

Add updated test

Ronak Lakhotia 6 years ago
parent
commit
9e8deea0d9
1 changed files with 11 additions and 4 deletions
  1. 11
    4
      exercises/list-ops/src/test/java/ListOpsTest.java

+ 11
- 4
exercises/list-ops/src/test/java/ListOpsTest.java View File

57
     @Ignore("Remove to run test")
57
     @Ignore("Remove to run test")
58
     @Test
58
     @Test
59
     public void testConcatOnNonEmptyListOfNestedLists() {
59
     public void testConcatOnNonEmptyListOfNestedLists() {
60
-        List<List<Character>> listOfLists = Arrays.asList(
61
-                Arrays.asList(Collections.singletonList('1'), Collections.singletonList('2')),
62
-                Arrays.asList(Collections.singletonList('3'), Collections.emptyList()),
60
+        List<List<List<Character>>> listOfNestedLists = Arrays.asList(
61
+                Arrays.asList(Collections.singletonList('1'),
62
+                Collections.singletonList('2')),
63
+                Arrays.asList(Collections.singletonList('3'),
64
+                Collections.emptyList()),
63
                 Arrays.asList(Arrays.asList('4', '5', '6'));
65
                 Arrays.asList(Arrays.asList('4', '5', '6'));
64
 
66
 
67
+        assertEquals(
68
+                Arrays.asList(Collections.singletonList('1'),
69
+                Collections.singletonList('2'), Collections.singletonList('3'),
70
+                Collections.emptyList(), Arrays.asList(4, 5, 6)),
71
+                ListOps.concat(listOfNestedLists));
65
     }
72
     }
66
-    
73
+
67
     @Ignore("Remove to run test")
74
     @Ignore("Remove to run test")
68
     @Test
75
     @Test
69
     public void testFilteringEmptyList() {
76
     public void testFilteringEmptyList() {