My dice game has a method rollAllDice() which is called when all the dice are rolled by a player. This inturn will call clearAllDiceSelections() method for deselecting the previous selection of all dice. Now I need to write test case for whether the dice were deselected or not ??
public void rollAllDice() {
clearAllDiceSelections();
for (Die d: f_dice) {
d.roll();
}
}
private void clearAllDiceSelections() {
for (Die d: f_dice) {
d.setSelected(false);
}
}
public void roll() {
f_faceValue = f_randgen.nextInt(f_sides) + 1;
}