Skip to content

Commit

Permalink
Add test for geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Oct 2, 2024
1 parent e95514d commit 2eb3c19
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.opentripplanner.street.model.edge;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Locale;
Expand Down Expand Up @@ -42,15 +43,15 @@ void testCycling() {
var edge = EscalatorEdge.createEscalatorEdge(from, to, 10);
var req = StreetSearchRequest.of().withMode(StreetMode.BIKE);
var res = edge.traverse(new State(from, req.build()));
assertEquals(res.length, 0);
assertThat(res).isEmpty();
}

@Test
void testWheelchair() {
var edge = EscalatorEdge.createEscalatorEdge(from, to, 10);
var req = StreetSearchRequest.of().withMode(StreetMode.WALK).withWheelchair(true);
var res = edge.traverse(new State(from, req.build()));
assertEquals(res.length, 0);
assertThat(res).isEmpty();
}

@Test
Expand All @@ -59,4 +60,10 @@ void name() {
assertEquals("Rolltreppe", edge.getName().toString(Locale.GERMANY));
assertEquals("escalator", edge.getName().toString(Locale.ENGLISH));
}

@Test
void geometry() {
var edge = EscalatorEdge.createEscalatorEdge(from, to, 10);
assertThat(edge.getGeometry().getCoordinates()).isNotEmpty();
}
}

0 comments on commit 2eb3c19

Please sign in to comment.