summaryrefslogtreecommitdiff
path: root/sw-server/src/test
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@gmail.com>2021-02-23 18:31:20 +0100
committerJoffrey Bion <joffrey.bion@gmail.com>2021-02-23 18:45:04 +0100
commitb9108dd5f848f13db157cdbe04a2b403e2d8ee7d (patch)
tree1708b619ed0687d638b6e1846770d9a2e5ef6e84 /sw-server/src/test
parentCleanup self board summary (diff)
downloadseven-wonders-b9108dd5f848f13db157cdbe04a2b403e2d8ee7d.tar.gz
seven-wonders-b9108dd5f848f13db157cdbe04a2b403e2d8ee7d.tar.bz2
seven-wonders-b9108dd5f848f13db157cdbe04a2b403e2d8ee7d.zip
Use proper sealed class for TurnActions
Diffstat (limited to 'sw-server/src/test')
-rw-r--r--sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt13
1 files changed, 8 insertions, 5 deletions
diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt
index df40b93d..7f05688b 100644
--- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt
+++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt
@@ -7,7 +7,7 @@ import kotlinx.coroutines.withTimeout
import kotlinx.coroutines.withTimeoutOrNull
import org.junit.runner.RunWith
import org.luxons.sevenwonders.client.*
-import org.luxons.sevenwonders.model.Action
+import org.luxons.sevenwonders.model.TurnAction
import org.luxons.sevenwonders.model.api.GameListEvent
import org.luxons.sevenwonders.model.api.LobbyDTO
import org.luxons.sevenwonders.server.test.runAsyncTest
@@ -15,7 +15,10 @@ import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
import org.springframework.boot.web.server.LocalServerPort
import org.springframework.test.context.junit4.SpringRunner
-import kotlin.test.*
+import kotlin.test.Test
+import kotlin.test.assertEquals
+import kotlin.test.assertNull
+import kotlin.test.assertTrue
@RunWith(SpringRunner::class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@@ -129,13 +132,13 @@ class SevenWondersTest {
).forEach { (session, startEvents) ->
launch {
val initialReadyTurn = startEvents.first()
- assertEquals(Action.SAY_READY, initialReadyTurn.action)
- assertNull(initialReadyTurn.hand)
+ assertTrue(initialReadyTurn.action is TurnAction.SayReady)
val turns = session.watchTurns()
session.sayReady()
val firstActualTurn = turns.first()
- assertNotNull(firstActualTurn.hand)
+ val action = firstActualTurn.action
+ assertTrue(action is TurnAction.PlayFromHand)
session.disconnect()
}
}
bgstack15