forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_496Test.java
41 lines (34 loc) · 1 KB
/
_496Test.java
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
package com.fishercoder;
import com.fishercoder.solutions._496;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertArrayEquals;
public class _496Test {
private static _496 test;
private static int[] findNums;
private static int[] nums;
private static int[] expected;
private static int[] actual;
@BeforeClass
public static void setup(){
test = new _496();
}
@Before
public void setupForEachTest(){
expected = new int[]{};
actual = new int[]{};
findNums = new int[]{};
nums = new int[]{};
}
@Test
public void test1(){
findNums = new int[]{4,1,2};
nums = new int[]{1,3,4,2};
expected = new int[]{-1, 3, -1};
actual = test.nextGreaterElement_naive_way(findNums, nums);
assertArrayEquals(expected, actual);
actual = test.nextGreaterElement_clever_way(findNums, nums);
assertArrayEquals(expected, actual);
}
}