Skip to content

Commit

Permalink
Test simulation input directives invariance
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelCourtney committed Nov 22, 2024
1 parent b97f551 commit c9abefa
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,28 @@ public void simResultMarkedNotStaleAfterRollback_SimulateThenCommit() {

assertFalse(simResults.isStale());
}

@Test
void simulationInputDirectivesDontChange() {
plan.create(
"BiteBanana",
new DirectiveStart.Absolute(Duration.MINUTE),
Map.of("biteSize", SerializedValue.of(1))
);

final var expectedDirectives = plan.directives();
final var simResults = plan.simulate();

plan.create(
"GrowBanana",
new DirectiveStart.Absolute(Duration.HOUR),
Map.of(
"growingDuration", SerializedValue.of(10),
"quantity", SerializedValue.of(1)
)
);

assertIterableEquals(expectedDirectives, simResults.inputDirectives());
assertNotEquals(plan.directives(), simResults.inputDirectives());
}
}

0 comments on commit c9abefa

Please sign in to comment.