Repository navigation
Expand file tree
/
Copy path_1232Test.java
More file actions
67 lines (58 loc) · 1.5 KB
/
Copy path_1232Test.java
File metadata and controls
67 lines (58 loc) · 1.5 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
package com.fishercoder;
import com.fishercoder.solutions._1232;
import org.junit.BeforeClass;
import org.junit.Test;
import static junit.framework.TestCase.assertEquals;
public class _1232Test {
private static _1232.Solution1 solution1;
private static int[][] coordinates;
@BeforeClass
public static void setup() {
solution1 = new _1232.Solution1();
}
@Test
public void test1() {
coordinates = new int[][]{
{1, 2},
{2, 3},
{3, 4},
{4, 5},
{5, 6},
{6, 7}
};
assertEquals(true, solution1.checkStraightLine(coordinates));
}
@Test
public void test2() {
coordinates = new int[][]{
{1, 1},
{2, 2},
{3, 4},
{4, 5},
{5, 6},
{7, 7}
};
assertEquals(false, solution1.checkStraightLine(coordinates));
}
@Test
public void test3() {
coordinates = new int[][]{
{-3, -2},
{-1, -2},
{2, -2},
{-2, -2},
{0, -2}
};
assertEquals(true, solution1.checkStraightLine(coordinates));
}
@Test
public void test4() {
coordinates = new int[][]{
{0, 1},
{1, 3},
{-4, -7},
{5, 11}
};
assertEquals(true, solution1.checkStraightLine(coordinates));
}
}