forked from alxsoares/topcoder-6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvenRouteTest.java
More file actions
74 lines (55 loc) · 1.58 KB
/
Copy pathEvenRouteTest.java
File metadata and controls
74 lines (55 loc) · 1.58 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class EvenRouteTest {
protected EvenRoute solution;
@Before
public void setUp() {
solution = new EvenRoute();
}
@Test(timeout = 2000)
public void testCase0() {
int[] x = new int[] { -1, -1, 1, 1 };
int[] y = new int[] { -1, 1, 1, -1 };
int wantedParity = 0;
String expected = "CAN";
String actual = solution.isItPossible(x, y, wantedParity);
Assert.assertEquals(expected, actual);
}
@Test(timeout = 2000)
public void testCase1() {
int[] x = new int[] { -5, -3, 2 };
int[] y = new int[] { 2, 0, 3 };
int wantedParity = 1;
String expected = "CAN";
String actual = solution.isItPossible(x, y, wantedParity);
Assert.assertEquals(expected, actual);
}
@Test(timeout = 2000)
public void testCase2() {
int[] x = new int[] { 1001, -4000 };
int[] y = new int[] { 0, 0 };
int wantedParity = 1;
String expected = "CAN";
String actual = solution.isItPossible(x, y, wantedParity);
Assert.assertEquals(expected, actual);
}
@Test(timeout = 2000)
public void testCase3() {
int[] x = new int[] { 11, 21, 0 };
int[] y = new int[] { -20, 42, 7 };
int wantedParity = 0;
String expected = "CANNOT";
String actual = solution.isItPossible(x, y, wantedParity);
Assert.assertEquals(expected, actual);
}
@Test(timeout = 2000)
public void testCase4() {
int[] x = new int[] { 0, 6 };
int[] y = new int[] { 10, -20 };
int wantedParity = 1;
String expected = "CANNOT";
String actual = solution.isItPossible(x, y, wantedParity);
Assert.assertEquals(expected, actual);
}
}