summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-24 01:51:56 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-24 01:51:56 +0200
commit4a98975b0da4baa4158140ba85f39ffa669ba7a8 (patch)
tree6fc390ed5b983ac8f7a70fc76967d68a3145e8f4 /test
parent92d110995488380778bd378f4297032a325dc385 (diff)
downloadJRummikub-4a98975b0da4baa4158140ba85f39ffa669ba7a8.tar
JRummikub-4a98975b0da4baa4158140ba85f39ffa669ba7a8.zip
Calculate points on hand
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@264 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test')
-rw-r--r--test/jrummikub/control/RoundControlTest.java2
-rw-r--r--test/jrummikub/model/HandTest.java17
2 files changed, 17 insertions, 2 deletions
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java
index 20d87f3..9894e35 100644
--- a/test/jrummikub/control/RoundControlTest.java
+++ b/test/jrummikub/control/RoundControlTest.java
@@ -591,7 +591,7 @@ public class RoundControlTest {
view.tablePanel.clickEvent.emit(new Position(0, 0));
- testRoundState.players.get(0).hand = new Hand();
+ testRoundState.players.get(0).hand = new Hand(gameSettings);
resetTurnStart();
view.playerPanel.endTurnEvent.emit();
diff --git a/test/jrummikub/model/HandTest.java b/test/jrummikub/model/HandTest.java
index fbe694b..5be48d6 100644
--- a/test/jrummikub/model/HandTest.java
+++ b/test/jrummikub/model/HandTest.java
@@ -19,7 +19,7 @@ public class HandTest {
/** */
@Before
public void setUp() {
- hand = new Hand();
+ hand = new Hand(new GameSettings());
}
/** */
@@ -111,4 +111,19 @@ public class HandTest {
assertEquals(new Position(13, 1), hand.getPosition(newStone));
assertEquals(new Position(0, 2), hand.getPosition(rowStones.get(13)));
}
+
+ /** */
+ @Test
+ public void testCountPoints() {
+
+ Stone stone1 = new Stone(2, BLUE);
+ Stone stone2 = new Stone(4, BLUE);
+ Stone stone3 = new Stone(RED);
+
+ hand.drop(stone1, new Position(0, 0));
+ hand.drop(stone2, new Position(0, 0));
+ hand.drop(stone3, new Position(0, 0));
+
+ assertEquals(56, hand.getStonePoints());
+ }
}