@Override public void setUpTwo() { try { initiateSettlement(); initiateRoad(); } catch (Exception e) { e.printStackTrace(); } }
@Override public void roll() { try { Dice roller = new Dice(2); int roll = roller.roll(); game.rollNumber(roll); } catch (Exception e) { e.printStackTrace(); } }
@Test public void testCanRollNumber() { game.setPhase(TurnTracker.Phase.ROLLING); final int turn = game.getCurrentTurn(); assertTrue(game.canRollNumber(turn)); try { game.getTurnTracker().nextPhase(); } catch (Exception e) { e.printStackTrace(); } assertFalse(game.canRollNumber(turn)); }
@Test public void testRollNumber() throws InvalidDiceRollException { final int turn = game.getCurrentTurn(); try { game.getTurnTracker().nextPhase(); game.getTurnTracker().nextPhase(); } catch (Exception e) { e.printStackTrace(); } final int roll = game.rollDice(turn); assertTrue(roll > 1); assertTrue(roll <= 12); }