From 5bd975306c4adeef5aafbea6eb7e038894cfca08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Paczos?= Date: Fri, 8 Mar 2019 14:06:36 +0100 Subject: [android] throw an exception if the component is accessed before the activation --- .../java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt') diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt index 01d8761cf3..dde03d8a14 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt @@ -594,15 +594,20 @@ class LocationComponentTest : EspressoTest() { val componentAction = object : LocationComponentAction.OnPerformLocationComponentAction { override fun onLocationComponentAction(component: LocationComponent, mapboxMap: MapboxMap, style: Style, uiController: UiController, context: Context) { - assertThat(component.isLocationComponentEnabled, `is`(false)) + component.onStop() component.onStart() - assertThat(component.isLocationComponentEnabled, `is`(false)) component.activateLocationComponent(LocationComponentActivationOptions .builder(context, style) .useDefaultLocationEngine(false) .build()) + + assertThat(component.isLocationComponentEnabled, `is`(false)) + component.onStop() + component.onStart() + assertThat(component.isLocationComponentEnabled, `is`(false)) + component.isLocationComponentEnabled = true assertThat(component.isLocationComponentEnabled, `is`(true)) } -- cgit v1.2.1