mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
* Updated language codes displayed for Hebrew, Indonesian and Yiddish (#2880) * Function 'fixLanguageCode' encapsulated with unit tests (#2880) * Renaming class "StringUtils" as "LangCodeUtils" and small String formatting improvement in "SpinnerLanguagesAdapter"
This commit is contained in:
parent
d22884f86a
commit
ee3f4d4d30
3 changed files with 56 additions and 5 deletions
|
|
@ -0,0 +1,24 @@
|
|||
package fr.free.nrw.commons.utils;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class LangCodeUtilsTest {
|
||||
@Test
|
||||
public void testFixLanguageCodeIw(){
|
||||
assertTrue("Expected 'he' as result", LangCodeUtils.fixLanguageCode("iw").contentEquals("he"));
|
||||
}
|
||||
@Test
|
||||
public void testFixLanguageCodeIn(){
|
||||
assertTrue("Expected 'id' as result", LangCodeUtils.fixLanguageCode("in").contentEquals("id"));
|
||||
}
|
||||
@Test
|
||||
public void testFixLanguageCodeJi(){
|
||||
assertTrue("Expected 'yi' as result", LangCodeUtils.fixLanguageCode("ji").contentEquals("yi"));
|
||||
}
|
||||
@Test
|
||||
public void testFixLanguageCodeDefault(){
|
||||
assertTrue("Expected 'en' as result", LangCodeUtils.fixLanguageCode("en").contentEquals("en"));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue