summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlangsmith <langstonlmcs@gmail.com>2019-02-11 15:18:27 -0800
committerlangsmith <langstonlmcs@gmail.com>2019-02-11 15:18:27 -0800
commit661565793587cf4e920fb24857385c3bbdbde770 (patch)
tree27bc1fb41e5e7968f4d676b9cb47dabeb5a0c913
parent26c8775d706eb1eacdc889f598b14ad25346087a (diff)
downloadqtlocation-mapboxgl-upstream/ls-adding-another-android-activateLocationComponent-constructor-variation.tar.gz
[android] added unit tests for new variation of activateLocationComponent()upstream/ls-adding-another-android-activateLocationComponent-constructor-variation
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt16
1 files changed, 16 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 0f316fa483..1928f692e1 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
@@ -105,6 +105,14 @@ class LocationComponentTest {
}
@Test
+ fun activateWithDefaultLocationEngineAndOptionsTestDefaultLocationEngine() {
+ locationComponent.activateLocationComponent(context, mockk(), true, locationComponentOptions)
+ Assert.assertNotNull(locationComponent.locationComponentOptions)
+ Assert.assertEquals(locationComponentOptions.foregroundName(), locationComponent.locationComponentOptions.foregroundName())
+ Assert.assertEquals(locationComponentOptions.accuracyColor(), locationComponent.locationComponentOptions.accuracyColor())
+ }
+
+ @Test
fun activateWithDefaultLocationEngineRequestAndOptionsTestCustomLocationEngine() {
locationComponent.activateLocationComponent(context, mockk(), false, locationEngineRequest, locationComponentOptions)
Assert.assertEquals(locationEngineRequest, locationComponent.locationEngineRequest)
@@ -112,6 +120,14 @@ class LocationComponentTest {
}
@Test
+ fun activateWithDefaultLocationEngineAndOptionsTestCustomLocationEngine() {
+ locationComponent.activateLocationComponent(context, mockk(), false, locationComponentOptions)
+ Assert.assertNotNull(locationComponent.locationComponentOptions)
+ Assert.assertEquals(locationComponentOptions.foregroundName(), locationComponent.locationComponentOptions.foregroundName())
+ Assert.assertEquals(locationComponentOptions.accuracyColor(), locationComponent.locationComponentOptions.accuracyColor())
+ }
+
+ @Test
fun locationUpdatesWhenEnabledDisableTest() {
locationComponent.activateLocationComponent(context, mockk(), locationEngine, locationEngineRequest, locationComponentOptions)
verify(locationEngine, times(0)).removeLocationUpdates(currentListener)