mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Moved tests over to Kotlin. (#1428)
This commit is contained in:
parent
6b2dd8c1df
commit
22772c851e
29 changed files with 1453 additions and 1679 deletions
23
app/src/test/kotlin/fr/free/nrw/commons/MediaTest.kt
Normal file
23
app/src/test/kotlin/fr/free/nrw/commons/MediaTest.kt
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package fr.free.nrw.commons
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(constants = BuildConfig::class, sdk = intArrayOf(21), application = TestCommonsApplication::class)
|
||||
class MediaTest {
|
||||
@Test
|
||||
fun displayTitleShouldStripExtension() {
|
||||
val m = Media("File:Example.jpg")
|
||||
assertEquals("Example", m.displayTitle)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun displayTitleShouldUseSpaceForUnderscore() {
|
||||
val m = Media("File:Example 1_2.jpg")
|
||||
assertEquals("Example 1 2", m.displayTitle)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue