@Test public void makeMoveWorksWithMoveChangesPlayer() { Move move = round.findMoves().get(0); round.makeMove(move.getY(), move.getX()); round.makeMove(move.getY2(), move.getX2()); assertEquals(false, round.isHumanTurn()); }
@Test public void makeMoveWorksWithMoveAfterMoveCancel() { round.makeMove(0, 0); round.makeMove(0, 0); Move move = round.findMoves().get(0); round.makeMove(move.getY(), move.getX()); assertEquals(true, round.makeMove(move.getY2(), move.getX2())); }
@Test(timeout = 4000) public void opponentReturnsTheTurn() { Move move = round.findMoves().get(0); round.makeMove(move.getY(), move.getX()); round.makeMove(move.getY2(), move.getX2()); while (round.makeMove(0, 0) == false) {} assertEquals(true, round.isHumanTurn()); }
@Test public void makeMoveDoesntWorkIfEarlierNotCancelled() { Move move = round.findMoves().get(0); int y = Math.max(size - 1, move.getY()); round.makeMove(y, 0); boolean test = round.makeMove(move.getY(), move.getX()); assertEquals(true, round.makeMove(move.getY2(), move.getX2()) == test); // makeMoven ei pitäisi palauttaa true kahdesti peräkkäin }