| 10 | import static org.junit.Assert.*; |
| 11 | |
| 12 | public class IntervalTest { |
| 13 | @Test |
| 14 | public void test_isNotPoint(){ |
| 15 | IntMock[] intervals = new IntMock[]{ |
| 16 | new IntMock(2, 1, Bounded.CLOSED), |
| 17 | new IntMock(2, 1, Bounded.CLOSED_LEFT), |
| 18 | new IntMock(2, 1, Bounded.CLOSED_RIGHT), |
| 19 | new IntMock(2, 1, Bounded.OPEN), |
| 20 | new IntMock(2, 2, Bounded.CLOSED_LEFT), |
| 21 | new IntMock(2, 2, Bounded.CLOSED_RIGHT), |
| 22 | new IntMock(2, 2, Bounded.OPEN), |
| 23 | new IntMock(2, Unbounded.CLOSED_LEFT), |
| 24 | new IntMock(2, Unbounded.CLOSED_RIGHT), |
| 25 | new IntMock(2, Unbounded.OPEN_RIGHT), |
| 26 | new IntMock(2, Unbounded.OPEN_LEFT), |
| 27 | new IntMock(9, 20, Bounded.CLOSED), |
| 28 | new IntMock(-1, 1, Bounded.CLOSED), |
| 29 | new IntMock(-123123, -4, Bounded.CLOSED), |
| 30 | new IntMock() |
| 31 | }; |
| 32 | for (Interval interval: intervals) |
| 33 | assertFalse(interval.isPoint()); |
| 34 | } |
| 35 | |
| 36 | @Test |
| 37 | public void test_isPoint(){ |
| 38 | IntMock[] intervals = new IntMock[]{ |
| 39 | new IntMock(22, 22, Bounded.CLOSED), |
| 40 | new IntMock(-11, -11, Bounded.CLOSED), |
| 41 | new IntMock(0, 0, Bounded.CLOSED) |
| 42 | }; |
| 43 | for (Interval interval: intervals) |
| 44 | assertTrue(interval.isPoint()); |
| 45 | } |
| 46 | |
| 47 | @Test |
| 48 | public void test_isEmpty(){ |
| 49 | IntMock[] intervals = new IntMock[]{ |
| 50 | new IntMock(2, 1, Bounded.CLOSED), |
| 51 | new IntMock(2, 1, Bounded.CLOSED_LEFT), |
| 52 | new IntMock(2, 1, Bounded.CLOSED_RIGHT), |
| 53 | new IntMock(2, 1, Bounded.OPEN), |
| 54 | new IntMock(2, 2, Bounded.CLOSED_LEFT), |
| 55 | new IntMock(2, 2, Bounded.CLOSED_RIGHT), |
| 56 | new IntMock(2, 2, Bounded.OPEN) |
| 57 | }; |
| 58 | for (Interval interval: intervals) |
| 59 | assertTrue(interval.isEmpty()); |
| 60 | } |
| 61 | |
| 62 | @Test |
| 63 | public void test_isNotEmpty(){ |
| 64 | IntMock[] intervals = new IntMock[]{ |
| 65 | new IntMock(2, 2, Bounded.CLOSED), |
| 66 | new IntMock(2, Unbounded.CLOSED_LEFT), |
| 67 | new IntMock(2, Unbounded.CLOSED_RIGHT), |
| 68 | new IntMock(2, Unbounded.OPEN_RIGHT), |
| 69 | new IntMock(2, Unbounded.OPEN_LEFT), |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…