Skip to content

Commit

Permalink
Merge pull request #62 from mapbox/cam-add-getter-for-options
Browse files Browse the repository at this point in the history
added getter for options class
  • Loading branch information
Cameron Mace authored May 26, 2017
2 parents 0ee20af + 2151854 commit 3dbbdea
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,16 @@ public void setConsiderTraffic(boolean disableTraffic) {
}
}

/**
* Get the currently used {@link MapboxNavigationOptions}, if one isn't set, the default values will be used.
*
* @return the set MapboxNavigationOptions object
* @since 0.3.0
*/
public MapboxNavigationOptions getMapboxNavigationOptions() {
return options;
}

/*
* Service methods
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import android.content.Context;

import junit.framework.Assert;

import org.junit.Test;
import org.mockito.Mockito;

Expand All @@ -14,4 +16,13 @@ public void sanityTest() {
MapboxNavigation navigation = new MapboxNavigation(Mockito.mock(Context.class), "pk.XXX");
assertNotNull("should not be null", navigation);
}

@Test
public void getMapboxNavigationOptions_currentOptionDoesReturn() {
MapboxNavigationOptions options = new MapboxNavigationOptions();
options.setManeuverZoneRadius(19.9999);
MapboxNavigation navigation = new MapboxNavigation(Mockito.mock(Context.class), "pk.XXX", options);
double actualValue = navigation.getMapboxNavigationOptions().getManeuverZoneRadius();
Assert.assertEquals(19.9999, actualValue, BaseTest.DELTA);
}
}

0 comments on commit 3dbbdea

Please sign in to comment.