🔀 Merge branch 'release/v82'
[Sone.git] / pterodactylus / sone / text / SonePartTest.kt
1 package net.pterodactylus.sone.text
2
3 import net.pterodactylus.sone.data.Profile
4 import net.pterodactylus.sone.data.Sone
5 import net.pterodactylus.sone.test.mock
6 import org.hamcrest.MatcherAssert.assertThat
7 import org.hamcrest.Matchers.`is`
8 import org.junit.Test
9 import org.mockito.Mockito.`when`
10
11 /**
12  * Unit test for [SonePart].
13  */
14 class SonePartTest {
15
16         private val sone = mock<Sone>()
17
18         init {
19                 `when`(sone.profile).thenReturn(mock())
20                 `when`(sone.name).thenReturn("sone")
21         }
22
23         private val part = SonePart(sone)
24
25         @Test
26         fun textIsConstructedFromSonesNiceName() {
27                 assertThat<String>(part.text, `is`<String>("sone"))
28         }
29
30 }