-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution030Test.java
More file actions
42 lines (31 loc) · 1.09 KB
/
Solution030Test.java
File metadata and controls
42 lines (31 loc) · 1.09 KB
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
38
39
40
41
42
package com.portgas;
import org.junit.Assert;
import org.junit.Test;
import java.util.List;
public class Solution030Test {
@Test
public void test() {
// 4 3 5 2 1
Solution030 stack = new Solution030();
stack.push(4);
stack.push(3);
stack.push(5);
stack.push(2);
stack.push(1);
Assert.assertEquals(stack.min(), 1);
System.out.println("当前最小值期望为1,实际为:" + stack.min());
stack.pop();
Assert.assertEquals(stack.min(), 2);
System.out.println("当前最小值期望为2,实际为:" + stack.min());
stack.pop();
Assert.assertEquals(stack.min(), 3);
System.out.println("当前最小值期望为3,实际为:" + stack.min());
stack.pop();
Assert.assertEquals(stack.min(), 3);
System.out.println("当前最小值期望为3,实际为:" + stack.min());
stack.pop();
Assert.assertEquals(stack.min(), 4);
System.out.println("当前最小值期望为4,实际为:" + stack.min());
stack.pop();
}
}