use of com.mapbox.services.android.navigation.v5.snap.Snap in project mapbox-navigation-android by mapbox.
the class MapboxNavigationTest method setSnapEngine_doesReplaceDefaultEngine.
@Test
public void setSnapEngine_doesReplaceDefaultEngine() throws Exception {
Snap snap = navigation.getSnapEngine();
assertTrue(snap instanceof SnapToRoute);
snap = mock(Snap.class);
navigation.setSnapEngine(snap);
assertTrue(!(navigation.getSnapEngine() instanceof SnapToRoute));
assertTrue(navigation.getSnapEngine() instanceof Snap);
}
use of com.mapbox.services.android.navigation.v5.snap.Snap in project mapbox-navigation-android by mapbox.
the class SnapToRouteTest method getSnappedLocation_returnsProviderNameCorrectly.
@Test
@Ignore
public void getSnappedLocation_returnsProviderNameCorrectly() throws Exception {
Snap snap = new SnapToRoute();
Location location = new Location("test");
List<Point> coordinates = PolylineUtils.decode(route.legs().get(0).steps().get(1).geometry(), Constants.PRECISION_6);
Location snappedLocation = snap.getSnappedLocation(location, routeProgress, coordinates);
assertTrue(snappedLocation.getProvider().equals("test-snapped"));
assertTrue(location.getProvider().equals("test"));
}
Aggregations