-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from sergio-sastre/release/1.2.2
Release/1.2.2
- Loading branch information
Showing
13 changed files
with
181 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
app/src/test/java/sergio/sastre/uitesting/myapplication/ExampleUnitTest.kt
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
app/src/test/java/sergio/sastre/uitesting/myapplication/LocaleUtilTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package sergio.sastre.uitesting.myapplication | ||
|
||
import org.junit.Test | ||
import sergio.sastre.uitesting.utils.common.LocaleUtil | ||
|
||
class LocaleUtilTests { | ||
|
||
@Test | ||
fun testLocaleWithAllVariants(){ | ||
val localeString = "zh-Latn-TW-pinyin" | ||
val locale = LocaleUtil.localeFromString(localeString) | ||
assert(locale.language == "zh") | ||
assert(locale.script == "Latn") | ||
assert(locale.country == "TW") | ||
assert(locale.variant == "pinyin") | ||
} | ||
|
||
@Test | ||
fun testSerbianLatin(){ | ||
val localeString = "sr-Latn-RS" | ||
val locale = LocaleUtil.localeFromString(localeString) | ||
assert(locale.language == "sr") | ||
assert(locale.script == "Latn") | ||
assert(locale.country == "RS") | ||
} | ||
|
||
@Test | ||
fun testSerbianCyrillic(){ | ||
val localeString = "sr-Cyrl-RS" | ||
val locale = LocaleUtil.localeFromString(localeString) | ||
assert(locale.language == "sr") | ||
assert(locale.script == "Cyrl") | ||
assert(locale.country == "RS") | ||
} | ||
|
||
@Test | ||
fun testSerbianRegion(){ | ||
val localeString = "sr-RS" | ||
val locale = LocaleUtil.localeFromString(localeString) | ||
assert(locale.language == "sr") | ||
assert(locale.country == "RS") | ||
} | ||
|
||
@Test | ||
fun testISOLocale(){ | ||
val localeString = "en_US" | ||
val locale = LocaleUtil.localeFromString(localeString) | ||
assert(locale.language == "en") | ||
assert(locale.country == "US") | ||
} | ||
|
||
@Test | ||
fun testPseudolocale(){ | ||
val localeString = "en_XA" | ||
val locale = LocaleUtil.localeFromString(localeString) | ||
assert(locale.language == "en") | ||
assert(locale.country == "XA") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.