summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlangsmith <langstonlmcs@gmail.com>2019-01-29 16:44:52 -0800
committerlangsmith <langstonlmcs@gmail.com>2019-01-29 16:44:52 -0800
commitb968931d211966e05e1d0f8d3e2c47b6bdf4a70d (patch)
tree764cecda228128a9e254b1181b6e15cb5241e825
parentcffb1e319a453257c442eb045da89ae2f1682f9c (diff)
downloadqtlocation-mapboxgl-b968931d211966e05e1d0f8d3e2c47b6bdf4a70d.tar.gz
[android] added new test for the new way to activate the LocationComponent
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
index cf513068ac..d380855b6c 100644
--- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
+++ b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
@@ -98,6 +98,26 @@ class LocationComponentTest {
}
@Test
+ fun activateWithDefaultLocationEngineRequestAndOptionsTest() {
+ locationComponent.activateLocationComponent(context, mockk(), true, locationEngineRequest, locationComponentOptions)
+
+ Assert.assertEquals(locationEngineRequest, locationComponent.locationEngineRequest)
+
+ doReturn(mock(TypedArray::class.java)).`when`(context)
+ .obtainStyledAttributes(R.style.mapbox_LocationComponent, R.styleable.mapbox_LocationComponent)
+
+ val resources = mock(Resources::class.java)
+
+ doReturn(resources).`when`(context).resources
+ doReturn(0f).`when`(resources)
+ .getDimension(R.dimen.mapbox_locationComponentTrackingMultiFingerMoveThreshold)
+ doReturn(0f).`when`(resources)
+ .getDimension(R.dimen.mapbox_locationComponentTrackingMultiFingerMoveThreshold)
+ locationComponent.activateLocationComponent(context, mockk(), true, locationEngineRequest, locationComponentOptions)
+ Assert.assertEquals(locationEngineRequest, locationComponent.locationEngineRequest)
+ }
+
+ @Test
fun locationUpdatesWhenEnabledDisableTest() {
locationComponent.activateLocationComponent(context, mockk(), locationEngine, locationEngineRequest, locationComponentOptions)
verify(locationEngine, times(0)).removeLocationUpdates(currentListener)