Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] test tweaks based on Lukasz review
Browse files Browse the repository at this point in the history
  • Loading branch information
langsmith committed Mar 5, 2019
1 parent 1c3c563 commit 00673b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ public Builder styleRes(int styleRes) {
* @param useDefaultLocationEngine true if you want to initialize and use the
* built-in location engine or false if there
* should be no location engine initialized
* This is ignored when null is set as the parameter
* for {@link LocationComponentActivationOptions#builder
* (Context, Style)#locationEngine()}.
* @return the {@link Builder} object being constructed
*/
public Builder useDefaultLocationEngine(boolean useDefaultLocationEngine) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public void includingBothStyleResAndComponentOptions_causesExceptionToBeThrown()
LocationComponentOptions locationComponentOptions = LocationComponentOptions.builder(context)
.accuracyAlpha(0.5f)
.build();
assertNotNull(locationComponentOptions);

LocationComponentActivationOptions.builder(context, style)
.locationComponentOptions(locationComponentOptions)
Expand All @@ -90,11 +89,6 @@ public void nullContext_causesExceptionToBeThrown() throws Exception {
thrown.expect(NullPointerException.class);
thrown.expectMessage("Context in LocationComponentActivationOptions is null.");

LocationComponentOptions locationComponentOptions = LocationComponentOptions.builder(context)
.accuracyAlpha(0.5f)
.build();
assertNotNull(locationComponentOptions);

LocationComponentActivationOptions.builder(null, style)
.build();
}
Expand All @@ -105,11 +99,6 @@ public void nullStyle_causesExceptionToBeThrown() throws Exception {
thrown.expectMessage("Style in LocationComponentActivationOptions is null. Make sure the Style object isn't null."
+ " Wait for the map to fully load before passing the Style object to LocationComponentActivationOptions.");

LocationComponentOptions locationComponentOptions = LocationComponentOptions.builder(context)
.accuracyAlpha(0.5f)
.build();
assertNotNull(locationComponentOptions);

LocationComponentActivationOptions.builder(context, null)
.build();
}
Expand All @@ -124,11 +113,6 @@ public void locationComponent_exceptionThrownWithDefaultLocationEngineButNotFull
+ "map to fully load before passing the Style object to "
+ "LocationComponentActivationOptions.");

LocationComponentOptions locationComponentOptions = LocationComponentOptions.builder(context)
.accuracyAlpha(0.5f)
.build();
assertNotNull(locationComponentOptions);

LocationComponentActivationOptions.builder(context, style)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class LocationComponentTest : EspressoTest() {

locationComponentActivationOptions = LocationComponentActivationOptions
.builder(context, style)
.locationEngine(null)
.useDefaultLocationEngine(false)
.locationComponentOptions(
LocationComponentOptions.builder(context)
.staleStateTimeout(200)
Expand Down Expand Up @@ -263,7 +263,7 @@ class LocationComponentTest : EspressoTest() {

locationComponentActivationOptions = LocationComponentActivationOptions
.builder(context, style)
.locationEngine(null)
.useDefaultLocationEngine(false)
.locationComponentOptions(
LocationComponentOptions.builder(context)
.foregroundName("custom-foreground-bitmap")
Expand Down Expand Up @@ -311,7 +311,7 @@ class LocationComponentTest : EspressoTest() {

locationComponentActivationOptions = LocationComponentActivationOptions
.builder(context, style)
.locationEngine(null)
.useDefaultLocationEngine(false)
.locationComponentOptions(
LocationComponentOptions.builder(context)
.foregroundName("custom-foreground-bitmap")
Expand Down Expand Up @@ -348,7 +348,7 @@ class LocationComponentTest : EspressoTest() {

locationComponentActivationOptions = LocationComponentActivationOptions
.builder(context, style)
.locationEngine(null)
.useDefaultLocationEngine(false)
.locationComponentOptions(
LocationComponentOptions.builder(context)
.foregroundName("custom-foreground-bitmap")
Expand Down Expand Up @@ -384,7 +384,7 @@ class LocationComponentTest : EspressoTest() {

locationComponentActivationOptions = LocationComponentActivationOptions
.builder(context, style)
.locationEngine(null)
.useDefaultLocationEngine(false)
.locationComponentOptions(
LocationComponentOptions.builder(context)
.gpsName("custom-gps-bitmap")
Expand Down Expand Up @@ -419,7 +419,7 @@ class LocationComponentTest : EspressoTest() {

locationComponentActivationOptions = LocationComponentActivationOptions
.builder(context, style)
.locationEngine(null)
.useDefaultLocationEngine(false)
.locationComponentOptions(
LocationComponentOptions.builder(context)
.staleStateTimeout(200)
Expand Down Expand Up @@ -488,7 +488,7 @@ class LocationComponentTest : EspressoTest() {

locationComponentActivationOptions = LocationComponentActivationOptions
.builder(context, style)
.locationEngine(null)
.useDefaultLocationEngine(false)
.locationComponentOptions(
LocationComponentOptions.builder(context)
.accuracyColor(color)
Expand Down

0 comments on commit 00673b6

Please sign in to comment.