Basic I18n stuff

This commit is contained in:
2019-02-07 21:20:07 +01:00
parent d6032a9e24
commit 943e747f8e
5 changed files with 123 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package totallynotmalware;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import totallynotmalware.i18n.I18n;
class TestI18n {
@BeforeEach
void setUp() throws Exception {
}
@Test
void testDefaultLang() {
assertEquals(I18n.get("title"), "Totally Not Malware");
}
}
+30
View File
@@ -0,0 +1,30 @@
package totallynotmalware;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import totallynotmalware.i18n.Language;
class TestLanguage {
Language en;
@BeforeEach
void setUp() throws Exception {
en=new Language("en");
}
@Test
void testGet() {
assertEquals(en.get("title"), "Totally Not Malware");
assertEquals(en.get("button"), "Th-thanks");
}
@Test
void testGetFallback() {
assertEquals(en.get("unknown.key"), "unknown.key");
}
}