Angefangener Test für Hand-Steine-verschwinden-fix
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@194 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
fffca3fe9a
commit
050ae5f224
4 changed files with 85 additions and 38 deletions
|
@ -49,7 +49,8 @@ public class RoundControlTest {
|
|||
- testGameState.table.getSize(), testGameState.getGameHeap()
|
||||
.getSize());
|
||||
for (int i = 0; i < testGameState.getPlayerCount(); i++) {
|
||||
assertEquals(14, testGameState.getNthNextPlayer(i).getHand().getSize());
|
||||
assertEquals(14, testGameState.getNthNextPlayer(i).getHand()
|
||||
.getSize());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,8 +68,8 @@ public class RoundControlTest {
|
|||
private void checkTableDisplay() {
|
||||
Iterator<Pair<StoneSet, Position>> stoneSetsView = view.tablePanel.stoneSets
|
||||
.iterator();
|
||||
Iterator<Pair<StoneSet, Position>> stoneSetsModel = testGameState.table.clone().sets
|
||||
.iterator();
|
||||
Iterator<Pair<StoneSet, Position>> stoneSetsModel = testGameState.table
|
||||
.clone().sets.iterator();
|
||||
|
||||
while (stoneSetsView.hasNext()) {
|
||||
assertTrue(stoneSetsModel.hasNext());
|
||||
|
@ -85,6 +86,17 @@ public class RoundControlTest {
|
|||
view.displayStartTurnPanel = false;
|
||||
}
|
||||
|
||||
// TODO hier weitermachen
|
||||
@Test
|
||||
public void testDealStone() {
|
||||
testRound.deal();
|
||||
checkCorrectlyDealed();
|
||||
for (int i = 0; i < 28 - 14; i++) {
|
||||
testRound.dealStone();
|
||||
}
|
||||
assertEquals(28, testGameState.getActivePlayer().getHand().getSize());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeal() {
|
||||
testRound.deal();
|
||||
|
@ -136,7 +148,8 @@ public class RoundControlTest {
|
|||
|
||||
view.startTurnEvent.emit();
|
||||
assertFalse(view.displayStartTurnPanel);
|
||||
Stone stone = testGameState.players.get(0).hand.stones.remove(0).getFirst();
|
||||
Stone stone = testGameState.players.get(0).hand.stones.remove(0)
|
||||
.getFirst();
|
||||
newTable.drop(new StoneSet(stone), new Position(0, 0));
|
||||
resetTurnStart();
|
||||
view.getPlayerPanel().endTurnEvent.emit();
|
||||
|
@ -194,7 +207,8 @@ public class RoundControlTest {
|
|||
|
||||
view.startTurnEvent.emit();
|
||||
assertFalse(view.displayStartTurnPanel);
|
||||
Stone stone = testGameState.players.get(0).hand.stones.remove(0).getFirst();
|
||||
Stone stone = testGameState.players.get(0).hand.stones.remove(0)
|
||||
.getFirst();
|
||||
newTable.drop(new StoneSet(stone), new Position(0, 0));
|
||||
testGameState.players.get(0).hand.stones.clear();
|
||||
resetTurnStart();
|
||||
|
@ -224,13 +238,13 @@ public class RoundControlTest {
|
|||
blueThree));
|
||||
newTable.drop(newSet1, new Position(0, 0));
|
||||
newTable.drop(newSet2, new Position(0, 0));
|
||||
|
||||
|
||||
Set<Stone> expectedStones = new HashSet<Stone>();
|
||||
expectedStones.add(blueThree);
|
||||
expectedStones.add(blueFour);
|
||||
|
||||
|
||||
Set<Stone> stones = RoundControl.tableDifference(oldTable, newTable);
|
||||
|
||||
|
||||
assertTrue(expectedStones.containsAll(stones));
|
||||
assertTrue(stones.containsAll(expectedStones));
|
||||
}
|
||||
|
|
Reference in a new issue