diff options
author | Langston Smith <langston.smith@mapbox.com> | 2019-01-31 07:20:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-31 07:20:25 -0800 |
commit | a2b49e9d22ad9c5bfb6a2ec05dc996be7c9449ea (patch) | |
tree | 3a5c860136604761cddf23f55b235b901663526a /platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt | |
parent | 429ea6aba5a2600628278d647cbd4eb0b1b7c968 (diff) | |
download | qtlocation-mapboxgl-a2b49e9d22ad9c5bfb6a2ec05dc996be7c9449ea.tar.gz |
[android] Adding new variation of LocationComponent#activateLocationComponent (#13829)
* [android] added new activateLocationComponent method
* [android] added new test for the new way to activate the LocationComponent
* [android] tweak to test after lukasz review
* [android] adding tests to assert LocationEngine status
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt | 14 |
1 files changed, 14 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..0f316fa483 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,20 @@ class LocationComponentTest { } @Test + fun activateWithDefaultLocationEngineRequestAndOptionsTestDefaultLocationEngine() { + locationComponent.activateLocationComponent(context, mockk(), true, locationEngineRequest, locationComponentOptions) + Assert.assertEquals(locationEngineRequest, locationComponent.locationEngineRequest) + Assert.assertNotNull(locationComponent.locationEngine) + } + + @Test + fun activateWithDefaultLocationEngineRequestAndOptionsTestCustomLocationEngine() { + locationComponent.activateLocationComponent(context, mockk(), false, locationEngineRequest, locationComponentOptions) + Assert.assertEquals(locationEngineRequest, locationComponent.locationEngineRequest) + Assert.assertNull(locationComponent.locationEngine) + } + + @Test fun locationUpdatesWhenEnabledDisableTest() { locationComponent.activateLocationComponent(context, mockk(), locationEngine, locationEngineRequest, locationComponentOptions) verify(locationEngine, times(0)).removeLocationUpdates(currentListener) |