From 661565793587cf4e920fb24857385c3bbdbde770 Mon Sep 17 00:00:00 2001 From: langsmith Date: Mon, 11 Feb 2019 15:18:27 -0800 Subject: [android] added unit tests for new variation of activateLocationComponent() --- .../mapbox/mapboxsdk/location/LocationComponentTest.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 @@ -104,6 +104,14 @@ class LocationComponentTest { Assert.assertNotNull(locationComponent.locationEngine) } + @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) @@ -111,6 +119,14 @@ class LocationComponentTest { Assert.assertNull(locationComponent.locationEngine) } + @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) -- cgit v1.2.1