🚧 Use strictly-filtered identities
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / freenet / BaseL10nTranslationTest.kt
1 package net.pterodactylus.sone.freenet
2
3 import freenet.l10n.*
4 import net.pterodactylus.sone.test.*
5 import org.hamcrest.MatcherAssert.*
6 import org.hamcrest.Matchers.*
7 import org.junit.*
8 import java.util.*
9
10 /**
11  * Test for [BaseL10nTranslation].
12  */
13 class BaseL10nTranslationTest {
14
15         private val baseL10n = mock<BaseL10n>()
16         private val translation = BaseL10nTranslation(baseL10n)
17
18         @Test
19         fun `translate method is facade for the correct method`() {
20                 whenever(baseL10n.getString("test")).thenReturn("answer")
21                 assertThat(translation.translate("test"), equalTo("answer"))
22         }
23
24         @Test
25         fun `language exposes correct short code`() {
26                 whenever(baseL10n.selectedLanguage).thenReturn(BaseL10n.LANGUAGE.ENGLISH)
27                 assertThat(translation.currentLocale, equalTo(Locale.ENGLISH))
28         }
29
30 }