forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_134Test.java
42 lines (35 loc) · 892 Bytes
/
_134Test.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
package com.fishercoder;
import com.fishercoder.solutions._134;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Created by fishercoder on 5/27/17.
*/
public class _134Test {
private static _134 test;
private static int[] gas;
private static int[] cost;
@BeforeClass
public static void setup(){
test = new _134();
}
@Test
public void test1(){
gas = new int[]{4};
cost = new int[]{5};
assertEquals(-1, test.canCompleteCircuit(gas, cost));
}
@Test
public void test2(){
gas = new int[]{5};
cost = new int[]{4};
assertEquals(0, test.canCompleteCircuit(gas, cost));
}
@Test
public void test3(){
gas = new int[]{2};
cost = new int[]{2};
assertEquals(0, test.canCompleteCircuit(gas, cost));
}
}