[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
This commit is contained in:
Langston Smith
2019-01-31 07:20:25 -08:00
committed by GitHub
parent 429ea6aba5
commit a2b49e9d22
2 changed files with 38 additions and 0 deletions

View File

@@ -97,6 +97,20 @@ class LocationComponentTest {
Assert.assertEquals(locationEngineRequest, locationComponent.locationEngineRequest)
}
@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)