summaryrefslogtreecommitdiff
path: root/sw-server/src/test/kotlin/org/luxons
diff options
context:
space:
mode:
authorjoffrey-bion <joffrey.bion@gmail.com>2021-02-09 17:10:41 +0100
committerjoffrey-bion <joffrey.bion@gmail.com>2021-02-09 17:12:22 +0100
commite7ee3ea35ad7188d32403933187c345442fbab0a (patch)
tree894879b14c8d89a9ed85d2e40341bb03dd3c9b50 /sw-server/src/test/kotlin/org/luxons
parentFix bot logger (diff)
downloadseven-wonders-e7ee3ea35ad7188d32403933187c345442fbab0a.tar.gz
seven-wonders-e7ee3ea35ad7188d32403933187c345442fbab0a.tar.bz2
seven-wonders-e7ee3ea35ad7188d32403933187c345442fbab0a.zip
Rename find->get to imply non-null check
Diffstat (limited to 'sw-server/src/test/kotlin/org/luxons')
-rw-r--r--sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/LobbyRepositoryTest.kt10
-rw-r--r--sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt6
2 files changed, 8 insertions, 8 deletions
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 8bef7efc..442edac2 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
@@ -41,7 +41,7 @@ class LobbyRepositoryTest {
@Test
fun find_failsOnUnknownId() {
assertFailsWith<LobbyNotFoundException> {
- repository.find(123)
+ repository.get(123)
}
}
@@ -49,8 +49,8 @@ class LobbyRepositoryTest {
fun find_returnsTheSameObject() {
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))
+ assertSame(lobby1, repository.get(lobby1.id))
+ assertSame(lobby2, repository.get(lobby2.id))
}
@Test
@@ -64,10 +64,10 @@ class LobbyRepositoryTest {
fun remove_succeeds() {
val owner = Player("owner", "The Owner")
val lobby1 = repository.create("Test Name 1", owner)
- assertNotNull(repository.find(lobby1.id))
+ assertNotNull(repository.get(lobby1.id))
repository.remove(lobby1.id)
try {
- repository.find(lobby1.id)
+ repository.get(lobby1.id)
fail() // the call to find() should have failed
} catch (e: LobbyNotFoundException) {
// the lobby has been properly removed
diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt
index fc016903..8e554546 100644
--- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt
+++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/repositories/PlayerRepositoryTest.kt
@@ -46,7 +46,7 @@ class PlayerRepositoryTest {
@Test
fun find_failsOnUnknownUsername() {
assertFailsWith<PlayerNotFoundException> {
- repository.find("anyUsername")
+ repository.get("anyUsername")
}
}
@@ -54,8 +54,8 @@ class PlayerRepositoryTest {
fun find_returnsTheSameObject() {
val player1 = repository.createOrUpdate("player1", "Player 1")
val player2 = repository.createOrUpdate("player2", "Player 2")
- assertSame(player1, repository.find("player1"))
- assertSame(player2, repository.find("player2"))
+ assertSame(player1, repository.get("player1"))
+ assertSame(player2, repository.get("player2"))
}
@Test
bgstack15