1 package net.pterodactylus.sone.freenet
4 import net.pterodactylus.sone.test.*
5 import org.hamcrest.MatcherAssert.*
6 import org.hamcrest.Matchers.*
11 * Test for [BaseL10nTranslation].
13 class BaseL10nTranslationTest {
15 private val baseL10n = mock<BaseL10n>()
16 private val translation = BaseL10nTranslation(baseL10n)
19 fun `translate method is facade for the correct method`() {
20 whenever(baseL10n.getString("test")).thenReturn("answer")
21 assertThat(translation.translate("test"), equalTo("answer"))
25 fun `language exposes correct short code`() {
26 whenever(baseL10n.selectedLanguage).thenReturn(BaseL10n.LANGUAGE.ENGLISH)
27 assertThat(translation.currentLocale, equalTo(Locale.ENGLISH))