mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
#3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version
This commit is contained in:
parent
d85d11441d
commit
e96b7f6f81
45 changed files with 927 additions and 1486 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package fr.free.nrw.commons
|
||||
|
||||
import media
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
|
@ -11,13 +12,15 @@ import org.robolectric.annotation.Config
|
|||
class MediaTest {
|
||||
@Test
|
||||
fun displayTitleShouldStripExtension() {
|
||||
val m = Media("File:Example.jpg")
|
||||
val m = media(filename = "File:Example.jpg")
|
||||
assertEquals("Example", m.displayTitle)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun displayTitleShouldUseSpaceForUnderscore() {
|
||||
val m = Media("File:Example 1_2.jpg")
|
||||
val m = media(filename = "File:Example 1_2.jpg")
|
||||
assertEquals("Example 1 2", m.displayTitle)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue