summaryrefslogtreecommitdiff
path: root/sw-server/src/test/kotlin/org
diff options
context:
space:
mode:
Diffstat (limited to 'sw-server/src/test/kotlin/org')
-rw-r--r--sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt7
-rw-r--r--sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt10
2 files changed, 6 insertions, 11 deletions
diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt
index 4125810f..7e27cf7f 100644
--- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt
+++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/lobby/LobbyTest.kt
@@ -34,24 +34,21 @@ class LobbyTest {
@Before
fun setUp() {
gameOwner = Player("gameowner", "Game owner")
- lobby = Lobby(0, "Test Game", gameOwner, gameDefinition)
+ lobby = Lobby(42, "Test Game", gameOwner, gameDefinition)
}
@Test
fun testId() {
- val lobby = Lobby(5, "Test Game", gameOwner, gameDefinition)
- assertEquals(5, lobby.id)
+ assertEquals(42, lobby.id)
}
@Test
fun testName() {
- val lobby = Lobby(5, "Test Game", gameOwner, gameDefinition)
assertEquals("Test Game", lobby.name)
}
@Test
fun testOwner() {
- val lobby = Lobby(5, "Test Game", gameOwner, gameDefinition)
assertSame(gameOwner, lobby.getPlayers()[0])
assertSame(lobby, gameOwner.lobby)
}
diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt
index c59dc49f..8bef7efc 100644
--- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt
+++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt
@@ -25,9 +25,8 @@ class LobbyRepositoryTest {
@Test
fun list_returnsAllLobbies() {
- val owner = Player("owner", "The Owner")
- val lobby1 = repository.create("Test Name 1", owner)
- val lobby2 = repository.create("Test Name 2", owner)
+ val lobby1 = repository.create("Test Name 1", Player("owner1", "The Owner"))
+ val lobby2 = repository.create("Test Name 2", Player("owner2", "The Owner"))
assertTrue(repository.list().contains(lobby1))
assertTrue(repository.list().contains(lobby2))
}
@@ -48,9 +47,8 @@ class LobbyRepositoryTest {
@Test
fun find_returnsTheSameObject() {
- val owner = Player("owner", "The Owner")
- val lobby1 = repository.create("Test Name 1", owner)
- val lobby2 = repository.create("Test Name 2", owner)
+ val lobby1 = repository.create("Test Name 1", Player("owner1", "The Owner"))
+ val lobby2 = repository.create("Test Name 2", Player("owner2", "The Owner"))
assertSame(lobby1, repository.find(lobby1.id))
assertSame(lobby2, repository.find(lobby2.id))
}
bgstack15