1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.geometry.core.partitioning;
18
19 import org.junit.jupiter.api.Assertions;
20 import org.junit.jupiter.api.Test;
21
22 class SplitTest {
23
24 @Test
25 void testProperties() {
26
27 final Object a = new Object();
28 final Object b = new Object();
29
30
31 final Split<Object> split = new Split<>(a, b);
32
33
34 Assertions.assertSame(a, split.getMinus());
35 Assertions.assertSame(b, split.getPlus());
36 }
37
38 @Test
39 void testGetLocation() {
40
41 final Object a = new Object();
42 final Object b = new Object();
43
44
45 Assertions.assertEquals(SplitLocation.NEITHER, new Split<>(null, null).getLocation());
46 Assertions.assertEquals(SplitLocation.MINUS, new Split<>(a, null).getLocation());
47 Assertions.assertEquals(SplitLocation.PLUS, new Split<>(null, b).getLocation());
48 Assertions.assertEquals(SplitLocation.BOTH, new Split<>(a, b).getLocation());
49 }
50
51 @Test
52 void testToString() {
53
54 final Split<String> split = new Split<>("a", "b");
55
56
57 final String str = split.toString();
58
59
60 Assertions.assertEquals("Split[location= BOTH, minus= a, plus= b]", str);
61 }
62 }