Test redealing in RoundControl
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@286 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
531fe57b17
commit
f7743efa7d
4 changed files with 49 additions and 13 deletions
|
@ -25,6 +25,7 @@ import jrummikub.model.Score;
|
|||
import jrummikub.model.Stone;
|
||||
import jrummikub.model.StoneSet;
|
||||
import jrummikub.model.Table;
|
||||
import jrummikub.util.IListener;
|
||||
import jrummikub.util.IListener1;
|
||||
import jrummikub.util.Pair;
|
||||
import jrummikub.view.MockView;
|
||||
|
@ -47,6 +48,7 @@ public class RoundControlTest {
|
|||
|
||||
private boolean roundEnded;
|
||||
private Score roundScore;
|
||||
protected boolean roundRestarted;
|
||||
|
||||
/**
|
||||
* For each test create a round control initialized by a mock model and view
|
||||
|
@ -888,4 +890,19 @@ public class RoundControlTest {
|
|||
assertFalse(14 == testRoundState.players.get(i).hand.getSize());
|
||||
}
|
||||
}
|
||||
|
||||
/** */
|
||||
@Test
|
||||
public void testRedeal() {
|
||||
testRound.getRestartRoundEvent().add(new IListener() {
|
||||
@Override
|
||||
public void handle() {
|
||||
roundRestarted = true;
|
||||
}
|
||||
});
|
||||
testRound.startRound();
|
||||
view.startTurnEvent.emit();
|
||||
view.playerPanel.redealEvent.emit();
|
||||
assertTrue(roundRestarted);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue