1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.geometry.core;
18
19 import org.junit.jupiter.api.Assertions;
20 import org.junit.jupiter.api.Test;
21
22 class SizedTest {
23
24 @Test
25 void testProperties() {
26
27 final Sized finite = new StubSized(1);
28 final Sized infinite = new StubSized(Double.POSITIVE_INFINITY);
29 final Sized nan = new StubSized(Double.NaN);
30
31
32 Assertions.assertTrue(finite.isFinite());
33 Assertions.assertFalse(finite.isInfinite());
34
35 Assertions.assertFalse(infinite.isFinite());
36 Assertions.assertTrue(infinite.isInfinite());
37
38 Assertions.assertFalse(nan.isFinite());
39 Assertions.assertFalse(nan.isInfinite());
40 }
41
42 private static class StubSized implements Sized {
43
44 private final double size;
45
46 StubSized(final double size) {
47 this.size = size;
48 }
49
50 @Override
51 public double getSize() {
52 return size;
53 }
54 }
55 }