@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)); }
@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)); }
@Before public void setUp() throws Exception { board = new Board(); board.setPiece("Pawn", 1, 1, Color.BLACK); }