Example #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)));
 }
Example #2
0
  @Test(expected = BoundaryException.class)
  public void testDecrementRankByBoundaryException() throws Exception {

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

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

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

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

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

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