示例#1
0
 @Test
 public void captureForwards() {
   board.setPiece("Pawn", 0, 2, Color.WHITE);
   board.setPiece("Pawn", 2, 2, Color.WHITE);
   assertTrue("Pawn captured forwards.", board.movePiece(1, 1, 0, 2));
   board.setPiece("Pawn", 1, 1, Color.BLACK);
   assertTrue("Pawn captured forwards.", board.movePiece(1, 1, 2, 2));
 }
示例#2
0
 @Test
 public void captureBackwards() {
   board.setPiece("Pawn", 0, 0, Color.WHITE);
   board.setPiece("Pawn", 2, 0, Color.WHITE);
   assertFalse("Pawns cannot capture backwards.", board.movePiece(1, 1, 2, 0));
 }
示例#3
0
 @Before
 public void setUp() throws Exception {
   board = new Board();
   board.setPiece("Pawn", 1, 1, Color.BLACK);
 }