예제 #1
0
  @Test
  public void distanceTest() {
    MyCoordinate coord1 = new MyCoordinate(0, 4);
    MyCoordinate coord2 = new MyCoordinate(0, 0);
    MyCoordinate coord3 = new MyCoordinate(-2, 2);
    MyCoordinate coord4 = new MyCoordinate(-1, 0);

    assertEquals(coord1.distance(coord2), 4);
    assertEquals(coord1.distance(coord3), 4);
    assertEquals(coord1.distance(coord4), 5);
  }
예제 #2
0
 @Test
 public void coordEqual() {
   MyCoordinate coord = new MyCoordinate(0, 0);
   assertFalse(coord.equals(new Board()));
   assertTrue(coord.equals(coord));
 }