Skip to content

Commit 10ddfbc

Browse files
marko-radosavljevicZabuzard
authored andcommitted
Change 'human attemts to exit elevator they are not currently in' test order
1 parent 34f863f commit 10ddfbc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Contest/Assignment/test/SanityTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ private static void verifySnapshotSanity(SimulationSnapshot previousSnapshot,
110110

111111
// Only if the human actually travelled around
112112
if (human.getStartingFloor() != human.getDestinationFloor()) {
113-
assertEquals(Human.State.TRAVELING_WITH_ELEVATOR, previousState,
114-
"When a human exits an elevator, their previous state must be traveling. But '%s' was in state %s.".formatted(
115-
human, previousState));
116-
117113
OptionalInt maybeElevatorId = previousHumanSnapshot.currentElevatorId();
118114
assertTrue(maybeElevatorId.isPresent(), ERROR_MESSAGE_PRE
119115
+ "When a human exits an elevator, they must have had a current elevator id previously. But '%s' does not.".formatted(
120116
human));
121117

118+
assertEquals(Human.State.TRAVELING_WITH_ELEVATOR, previousState,
119+
"When a human exits an elevator, their previous state must be traveling. But '%s' was in state %s.".formatted(
120+
human, previousState));
121+
122122
ElevatorSnapshot currentElevatorSnapshot =
123123
currentSnapshot.getElevatorSnapshot(maybeElevatorId.orElseThrow());
124124
assertEquals(human.getDestinationFloor(),

0 commit comments

Comments
 (0)