diff --git a/src/test/kotlin/util/ecs/storage/ComponentMapTest.kt b/src/test/kotlin/util/ecs/storage/ComponentMapTest.kt index 49028db..da4177b 100644 --- a/src/test/kotlin/util/ecs/storage/ComponentMapTest.kt +++ b/src/test/kotlin/util/ecs/storage/ComponentMapTest.kt @@ -31,6 +31,10 @@ private val storage = ComponentMap(TYPE, components) class ComponentMapTest { + @Test + fun `Get correct type`() { + assertThat(storage.getType()).isSameAs(TYPE) + } @Nested inner class Has { diff --git a/src/test/kotlin/util/log/MessageLogTest.kt b/src/test/kotlin/util/log/MessageLogTest.kt index 22e5d98..f3629b6 100644 --- a/src/test/kotlin/util/log/MessageLogTest.kt +++ b/src/test/kotlin/util/log/MessageLogTest.kt @@ -9,6 +9,10 @@ import util.ecs.EcsState class MessageLogTest { + private val message0 = mockk() + private val message1 = mockk() + private val message2 = mockk() + @Test fun `Test empty constructor`() { assertThat(MessageLog()).isEqualTo(MessageLog(emptyList())) @@ -16,8 +20,6 @@ class MessageLogTest { @Test fun `Add a message to the message log`() { - val message0 = mockk() - val message1 = mockk() val log = MessageLog(listOf(message0)) val newLog = log.add(message1) @@ -25,10 +27,17 @@ class MessageLogTest { assertThat(newLog).isEqualTo(MessageLog(listOf(message0, message1))) } + @Test + fun `Add messages to the message log`() { + val log = MessageLog(listOf(message0)) + + val newLog = log.add(listOf(message1, message2)) + + assertThat(newLog).isEqualTo(MessageLog(listOf(message0, message1, message2))) + } + @Test fun `Add a message to the state`() { - val message0 = mockk() - val message1 = mockk() val log = MessageLog(listOf(message0)) val state = EcsState(dataMap = mapOf(MessageLog::class to log))