forked from ucsd-cse15l-f23/lab3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinkedListTests.java
More file actions
37 lines (28 loc) · 763 Bytes
/
Copy pathLinkedListTests.java
File metadata and controls
37 lines (28 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import static org.junit.Assert.*;
import org.junit.Test;
public class LinkedListTests {
@Test
public void testPrepend(){
LinkedList list = new LinkedList();
list.prepend(1);
list.prepend(2);
list.prepend(3);
list.prepend(4);
list.prepend(5);
assertEquals(5, list.first());
assertEquals(1, list.last());
assertEquals(5, list.length());
}
@Test
public void testAppend(){
LinkedList list = new LinkedList();
list.append(1);
list.append(2);
list.append(3);
list.append(4);
list.append(5);
assertEquals(1, list.first());
assertEquals(5, list.last());
assertEquals(5, list.length());
}
}