Search in sources :

Example 1 with LocationEngine

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);
}
Also used : LocationEngine(com.mapbox.services.android.telemetry.location.LocationEngine) MockLocationEngine(com.mapbox.services.android.navigation.v5.location.MockLocationEngine) MockLocationEngine(com.mapbox.services.android.navigation.v5.location.MockLocationEngine)

Example 2 with 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());
}
Also used : LocationEngine(com.mapbox.services.android.telemetry.location.LocationEngine) Test(org.junit.Test) BaseTest(com.mapbox.services.android.navigation.v5.BaseTest)

Aggregations

LocationEngine (com.mapbox.services.android.telemetry.location.LocationEngine)2 BaseTest (com.mapbox.services.android.navigation.v5.BaseTest)1 MockLocationEngine (com.mapbox.services.android.navigation.v5.location.MockLocationEngine)1 Test (org.junit.Test)1