apps-android-commons/app/src/test/kotlin/fr/free/nrw/commons/NearbyControllerTest.kt
Shubham Pinjwani 9451b00a15 Show bookmarked nearby locations differently (#2059) (#2349)
* Show bookmarked nearby locations differently (#2059)

* added custom bookmark marker

* passed value of bookmarkplacelist in tests

* update the nearby markers on clicking bookmark buttons
2019-02-02 19:13:42 +05:30

35 lines
1.1 KiB
Kotlin

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 = [21], application = TestCommonsApplication::class)
class NearbyControllerTest {
@Test
fun testNullAttractions() {
val location = LatLng(0.0, 0.0, 0f)
val options = loadAttractionsFromLocationToBaseMarkerOptions(
location, null, RuntimeEnvironment.application, null)
assertEquals(0, options.size.toLong())
}
@Test
fun testEmptyList() {
val location = LatLng(0.0, 0.0, 0f)
val options = loadAttractionsFromLocationToBaseMarkerOptions(
location, emptyList(), RuntimeEnvironment.application, emptyList())
assertEquals(0, options.size.toLong())
}
}