Replace most parts with Kotlin equivalents
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / text / SonePartTest.kt
diff --git a/src/test/kotlin/net/pterodactylus/sone/text/SonePartTest.kt b/src/test/kotlin/net/pterodactylus/sone/text/SonePartTest.kt
new file mode 100644 (file)
index 0000000..361bd19
--- /dev/null
@@ -0,0 +1,30 @@
+package net.pterodactylus.sone.text
+
+import net.pterodactylus.sone.data.Profile
+import net.pterodactylus.sone.data.Sone
+import net.pterodactylus.sone.test.mock
+import org.hamcrest.MatcherAssert.assertThat
+import org.hamcrest.Matchers.`is`
+import org.junit.Test
+import org.mockito.Mockito.`when`
+
+/**
+ * Unit test for [SonePart].
+ */
+class SonePartTest {
+
+       private val sone = mock<Sone>()
+
+       init {
+               `when`(sone.profile).thenReturn(mock<Profile>())
+               `when`(sone.name).thenReturn("sone")
+       }
+
+       private val part = SonePart(sone)
+
+       @Test
+       fun textIsConstructedFromSonesNiceName() {
+               assertThat<String>(part.text, `is`<String>("sone"))
+       }
+
+}