summaryrefslogtreecommitdiff
path: root/backend/src/test/java/org
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2017-05-15 20:56:33 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2017-05-15 20:56:33 +0200
commitcb2a5130ed7f133941935b981fec89b7e9b4b644 (patch)
tree348a6732aee4516ccd19e266fc7f5b7605224627 /backend/src/test/java/org
parentAdd test for Lobby.removePlayer() (diff)
downloadseven-wonders-cb2a5130ed7f133941935b981fec89b7e9b4b644.tar.gz
seven-wonders-cb2a5130ed7f133941935b981fec89b7e9b4b644.tar.bz2
seven-wonders-cb2a5130ed7f133941935b981fec89b7e9b4b644.zip
Add test for Lobby owner index
Diffstat (limited to 'backend/src/test/java/org')
-rw-r--r--backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java b/backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java
index 9ce4ce0c..8a428aef 100644
--- a/backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java
+++ b/backend/src/test/java/org/luxons/sevenwonders/lobby/LobbyTest.java
@@ -21,6 +21,7 @@ import org.luxons.sevenwonders.lobby.Lobby.UnknownPlayerException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
@@ -65,6 +66,14 @@ public class LobbyTest {
}
@Test
+ public void testOwner() {
+ gameOwner.setIndex(42);
+ Lobby l = new Lobby(5, "Test Game", gameOwner, gameDefinition);
+ assertSame(gameOwner, l.getPlayers().get(0));
+ assertEquals(0, gameOwner.getIndex());
+ }
+
+ @Test
public void isOwner_falseWhenNull() {
assertFalse(lobby.isOwner(null));
}
bgstack15