forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_495Test.java
55 lines (48 loc) · 1.28 KB
/
_495Test.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.fishercoder;
import com.fishercoder.solutions._495;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Created by fishercoder on 5/8/17.
*/
public class _495Test {
private static int actual = 0;
private static int expected = 0;
private static int[] timeSeries;
private static int duration = 0;
@Before
public void setup() {
timeSeries = new int[]{};
duration = 0;
expected = 0;
actual = 0;
}
@Test
public void test1() {
_495 test = new _495();
timeSeries = new int[]{1,4};
duration = 2;
actual = test.findPoisonedDuration(timeSeries, duration);
expected = 4;
assertEquals(expected, actual);
}
@Test
public void test2() {
_495 test = new _495();
timeSeries = new int[]{1,2};
duration = 2;
actual = test.findPoisonedDuration(timeSeries, duration);
expected = 3;
assertEquals(expected, actual);
}
@Test
public void test3() {
_495 test = new _495();
timeSeries = new int[]{};
duration = 100000;
actual = test.findPoisonedDuration(timeSeries, duration);
expected = 0;
assertEquals(expected, actual);
}
}