mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53: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
|
|
@ -0,0 +1,35 @@
|
|||
package fr.free.nrw.commons
|
||||
|
||||
import fr.free.nrw.commons.location.LatLng
|
||||
import fr.free.nrw.commons.nearby.NearbyController.loadAttractionsFromLocationToBaseMarkerOptions
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(constants = BuildConfig::class, sdk = intArrayOf(21), application = TestCommonsApplication::class)
|
||||
class NearbyControllerTest {
|
||||
|
||||
@Test
|
||||
fun testNullAttractions() {
|
||||
val location = LatLng(0.0, 0.0, 0f)
|
||||
|
||||
val options = loadAttractionsFromLocationToBaseMarkerOptions(
|
||||
location, null, RuntimeEnvironment.application)
|
||||
|
||||
assertEquals(0, options.size.toLong())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testEmptyList() {
|
||||
val location = LatLng(0.0, 0.0, 0f)
|
||||
|
||||
val options = loadAttractionsFromLocationToBaseMarkerOptions(
|
||||
location, emptyList(), RuntimeEnvironment.application)
|
||||
|
||||
assertEquals(0, options.size.toLong())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue