forked from javadev/LeetCode-in-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolutionTest.java
More file actions
72 lines (61 loc) · 2 KB
/
SolutionTest.java
File metadata and controls
72 lines (61 loc) · 2 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
package g0801_0900.s0836_rectangle_overlap;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.jupiter.api.Test;
class SolutionTest {
@Test
void isRectangleOverlap() {
assertThat(
new Solution().isRectangleOverlap(new int[] {0, 0, 2, 2}, new int[] {1, 1, 3, 3}),
equalTo(true));
}
@Test
void isRectangleOverlap2() {
assertThat(
new Solution().isRectangleOverlap(new int[] {0, 0, 1, 1}, new int[] {1, 0, 2, 1}),
equalTo(false));
}
@Test
void isRectangleOverlap3() {
assertThat(
new Solution().isRectangleOverlap(new int[] {0, 0, 1, 1}, new int[] {2, 2, 3, 3}),
equalTo(false));
}
@Test
void isRectangleOverlap4() {
assertThat(
new Solution().isRectangleOverlap(new int[] {0, 0, 2, 2}, new int[] {0, 2, 2, 4}),
equalTo(false));
}
@Test
void isRectangleOverlap5() {
assertThat(
new Solution().isRectangleOverlap(new int[] {1, 1, 3, 3}, new int[] {1, 0, 3, 1}),
equalTo(false));
}
@Test
void isRectangleOverlap6() {
assertThat(
new Solution()
.isRectangleOverlap(new int[] {-3, -3, -1, -1}, new int[] {-2, -2, 0, 0}),
equalTo(true));
}
@Test
void isRectangleOverlap7() {
assertThat(
new Solution().isRectangleOverlap(new int[] {0, 0, 4, 4}, new int[] {1, 1, 3, 3}),
equalTo(true));
}
@Test
void isRectangleOverlap8() {
assertThat(
new Solution().isRectangleOverlap(new int[] {0, 0, 2, 2}, new int[] {0, 0, 2, 2}),
equalTo(true));
}
@Test
void isRectangleOverlap9() {
assertThat(
new Solution().isRectangleOverlap(new int[] {0, 0, 1, 1}, new int[] {1, 1, 2, 2}),
equalTo(false));
}
}