forked from jieli4970/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
25 lines (18 loc) · 662 Bytes
/
Test.java
File metadata and controls
25 lines (18 loc) · 662 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
import org.junit.Assert;
public class Test {
@org.junit.Test
public void ListStackTest() throws Exception {
MyQueue<Integer> queue = new ListQueue<>();
queue.add(1).add(2).add(3).add(4);
for (Integer item : queue) {
System.out.println(item);
}
Assert.assertEquals(queue.size(), 4);
Assert.assertFalse(queue.isEmpty());
Assert.assertEquals(1, (int) queue.remove());
Assert.assertEquals(2, (int) queue.remove());
Assert.assertEquals(3, (int) queue.remove());
Assert.assertEquals(4, (int) queue.remove());
Assert.assertTrue(queue.isEmpty());
}
}