コード例 #1
0
 @Test
 public void testTargetContainsCoordinates() {
   final Target t1 = new Target(new Coordinates(new Coordinate(0, 0), new Coordinate(5, 0)));
   for (final Coordinate c : t1.coordinates) {
     assertThat("t1 does not contain c", t1.contains(c));
   }
 }
コード例 #2
0
 @Test
 public void testTargetIntersects() {
   final Target t1 = new Target(new Coordinates(new Coordinate(0, 0), new Coordinate(5, 0)));
   final Target t2 = new Target(new Coordinates(new Coordinate(5, 0), new Coordinate(9, 0)));
   assertThat("t1 does not intersect t2", t1.intersects(t2));
 }