use of com.mapbox.services.android.telemetry.location.LocationEngine in project mapbox-navigation-android by mapbox.
the class LocationViewModel method activateMockLocationEngine.
/**
* Activates a new {@link MockLocationEngine} with the given
* {@link DirectionsRoute}.
*
* @param route to be mocked
*/
private void activateMockLocationEngine(DirectionsRoute route) {
LocationEngine locationEngine = new MockLocationEngine(1000, 30, false);
((MockLocationEngine) locationEngine).setRoute(route);
locationEngine.activate();
this.locationEngine.setValue(locationEngine);
}
use of com.mapbox.services.android.telemetry.location.LocationEngine in project mapbox-navigation-android by mapbox.
the class MapboxNavigationTest method getLocationEngine_returnsCorrectLocationEngine.
@Test
public void getLocationEngine_returnsCorrectLocationEngine() throws Exception {
LocationEngine locationEngine = mock(LocationEngine.class);
LocationEngine locationEngine2 = mock(LocationEngine.class);
navigation.setLocationEngine(locationEngine);
assertNotSame(locationEngine2, navigation.getLocationEngine());
assertEquals(locationEngine, navigation.getLocationEngine());
}
Aggregations