mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
* Show bookmarked nearby locations differently (#2059) * added custom bookmark marker * passed value of bookmarkplacelist in tests * update the nearby markers on clicking bookmark buttons
35 lines
1.1 KiB
Kotlin
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())
|
|
}
|
|
}
|