forked from ucsd-cse15l-w23/lab3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListTests.java
More file actions
24 lines (21 loc) · 748 Bytes
/
ListTests.java
File metadata and controls
24 lines (21 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import static org.junit.Assert.*;
import org.junit.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
public class ListTests{
@Test
public void testFilter(){
List<String> lst1 = Arrays.asList("abc", "bce", "bcd", "app", "bee", "foo");
StringsCheck sc = new StringsCheck("bc");
List<String> exp = Arrays.asList("abc", "bce", "bcd");
assertEquals(exp, ListExamples.filter(lst1, sc));
}
@Test
public void testMerge(){
List<String> ls1 =Arrays.asList("a", "d", "e");
List<String> ls2 = Arrays.asList("b", "c", "f");
List<String> ls3 = Arrays.asList("a", "b", "c", "d", "e", "f");
assertEquals(ls3, ListExamples.merge(ls1, ls2));
}
}