Esempio n. 1
0
 @Test
 public void testcolor() {
   assertEquals(Color.BLACK, board.getColor(new Square("a", 1)));
   assertEquals(Color.WHITE, board.getColor(new Square("e", 4)));
   assertEquals(Color.BLACK, board.getColor(new Square("h", 18)));
   assertEquals(Color.WHITE, board.getColor(new Square("d", 5)));
 }
Esempio n. 2
0
  @Test(expected = BoundaryException.class)
  public void testDecrementRankByBoundaryException() throws Exception {

    board.decrementRankBy(1, 3);
  }
Esempio n. 3
0
  @Test
  public void testDecrementRankBy() throws Exception {

    assertEquals(Integer.valueOf(4), board.decrementRankBy(7, 3));
  }
Esempio n. 4
0
  @Test(expected = BoundaryException.class)
  public void testIncrementRankByBoundaryException() throws Exception {

    board.incrementRankBy(8, 1);
  }
Esempio n. 5
0
  @Test
  public void testIncrementRankBy() throws Exception {

    assertEquals(Integer.valueOf(3), board.incrementRankBy(1, 2));
  }
Esempio n. 6
0
  @Test
  public void testDecrementFileBy() throws Exception {

    assertEquals("c", board.decrementFileBy("f", 3));
  }
Esempio n. 7
0
  @Test
  public void testIncrementFileBy() throws Exception {

    assertEquals("c", board.incrementFileBy("a", 2));
  }