Basic I18n stuff
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user