Skip to content

Commit

Permalink
refactor: Rename ViaLocationDeprecatedTest to ViaLocationTest
Browse files Browse the repository at this point in the history
ViaLocationTest
  • Loading branch information
t2gran committed Sep 22, 2024
1 parent bc7c243 commit 0be98db
Showing 1 changed file with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.opentripplanner.raptor.api.model.RaptorConstants;
import org.opentripplanner.raptor.api.model.RaptorTransfer;

class ViaLocationDeprecatedTest {
class ViaLocationTest {

private static final int STOP_A = 12;
private static final int STOP_B = 13;
Expand All @@ -37,7 +37,7 @@ void passThroughStop() {
assertEquals(RaptorConstants.ZERO, subject.minimumWaitTime());
assertEquals(
"Via{label: PassThrough A, allowPassThrough, connections: [C]}",
subject.toString(ViaLocationDeprecatedTest::stopName)
subject.toString(ViaLocationTest::stopName)
);
assertEquals(
"Via{label: PassThrough A, allowPassThrough, connections: [14]}",
Expand All @@ -61,10 +61,7 @@ void viaSingleStop() {
assertEquals("Tx A", subject.label());
assertFalse(subject.allowPassThrough());
assertEquals(RaptorConstants.ZERO, subject.minimumWaitTime());
assertEquals(
"Via{label: Tx A, connections: [B]}",
subject.toString(ViaLocationDeprecatedTest::stopName)
);
assertEquals("Via{label: Tx A, connections: [B]}", subject.toString(ViaLocationTest::stopName));
assertEquals("Via{label: Tx A, connections: [13]}", subject.toString());
assertEquals(1, subject.connections().size());

Expand All @@ -89,7 +86,7 @@ void testCombinationOfPassThroughAndTransfer() {
assertEquals(RaptorConstants.ZERO, subject.minimumWaitTime());
assertEquals(
"Via{label: PassThrough A, allowPassThrough, connections: [C, A~B 35s]}",
subject.toString(ViaLocationDeprecatedTest::stopName)
subject.toString(ViaLocationTest::stopName)
);
assertEquals(2, subject.connections().size());

Expand Down Expand Up @@ -121,7 +118,7 @@ void viaStopAorCWithWaitTime() {
assertEquals(WAIT_TIME_SEC, subject.minimumWaitTime());
assertEquals(
"Via{label: Plaza, minWaitTime: 3m, connections: [C 3m, A~B 3m35s]}",
subject.toString(ViaLocationDeprecatedTest::stopName)
subject.toString(ViaLocationTest::stopName)
);
assertEquals(2, subject.connections().size());

Expand Down Expand Up @@ -221,28 +218,25 @@ void testToString() {
assertEquals("Via{label: A|B, connections: [12, 13]}", subject.toString());
assertEquals(
"Via{label: A|B, connections: [A, B]}",
subject.toString(ViaLocationDeprecatedTest::stopName)
subject.toString(ViaLocationTest::stopName)
);

subject = RaptorViaLocation.via(null, WAIT_TIME).addViaStop(STOP_B).build();
assertEquals("Via{minWaitTime: 3m, connections: [13 3m]}", subject.toString());
assertEquals(
"Via{minWaitTime: 3m, connections: [B 3m]}",
subject.toString(ViaLocationDeprecatedTest::stopName)
subject.toString(ViaLocationTest::stopName)
);

subject = RaptorViaLocation.via(null).addViaTransfer(STOP_A, TX).build();
assertEquals("Via{connections: [12~13 35s]}", subject.toString());
assertEquals(
"Via{connections: [A~B 35s]}",
subject.toString(ViaLocationDeprecatedTest::stopName)
);
assertEquals("Via{connections: [A~B 35s]}", subject.toString(ViaLocationTest::stopName));

subject = RaptorViaLocation.allowPassThrough(null).addViaStop(STOP_C).build();
assertEquals("Via{allowPassThrough, connections: [14]}", subject.toString());
assertEquals(
"Via{allowPassThrough, connections: [C]}",
subject.toString(ViaLocationDeprecatedTest::stopName)
subject.toString(ViaLocationTest::stopName)
);
}

Expand Down

0 comments on commit 0be98db

Please sign in to comment.