mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Merge branch 'master' into dependency-injection
This commit is contained in:
commit
02b5b9b680
148 changed files with 1169 additions and 364 deletions
31
app/src/test/kotlin/fr/free/nrw/commons/UtilsTest.kt
Normal file
31
app/src/test/kotlin/fr/free/nrw/commons/UtilsTest.kt
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package fr.free.nrw.commons
|
||||
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.hamcrest.CoreMatchers.`is` as _is
|
||||
|
||||
class UtilsTest {
|
||||
@Test fun `strip nothing from non-localized string`() {
|
||||
Assert.assertThat(Utils.stripLocalizedString("Hello"), _is("Hello"))
|
||||
}
|
||||
|
||||
@Test fun `strip tag from Japanese string`() {
|
||||
Assert.assertThat(Utils.stripLocalizedString("\"こんにちは\"@ja"), _is("こんにちは"))
|
||||
}
|
||||
|
||||
@Test fun `capitalize first letter`() {
|
||||
Assert.assertThat(Utils.capitalize("hello"), _is("Hello"))
|
||||
}
|
||||
|
||||
@Test fun `capitalize - pass all-capital string as it is`() {
|
||||
Assert.assertThat(Utils.capitalize("HELLO"), _is("HELLO"))
|
||||
}
|
||||
|
||||
@Test fun `capitalize - pass numbers`() {
|
||||
Assert.assertThat(Utils.capitalize("12x"), _is("12x"))
|
||||
}
|
||||
|
||||
@Test fun `capitalize - pass Japanase characters`() {
|
||||
Assert.assertThat(Utils.capitalize("こんにちは"), _is("こんにちは"))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue