Skip to content

Instantly share code, notes, and snippets.

@beyondxscratch
Last active May 21, 2019 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beyondxscratch/99998bd437479f1bc1955a4c6ca2f497 to your computer and use it in GitHub Desktop.
Save beyondxscratch/99998bd437479f1bc1955a4c6ca2f497 to your computer and use it in GitHub Desktop.
public class StepDefs implements En {
public StepDefs() {
Given("^a cinephile$", () -> me = new Cinephile("me"));
Given("^the last showing is not started yet$",
() -> lastShowing = new Showing(now().plusHours(3)));
When("^the user asks for the next showings$",
() -> nextShowings = searchShowings.searchNextShowingsFor(me));
Then("^the returned showings are not started yet$", () -> {
assertThat(allShowings.stream().filter(showing -> !showing.hasStarted()))
.containsAnyElementsOf(nextShowings);
});
Then("^the returned showings are not starting in the next 15 minutes$", () -> {
assertThat(nextShowings)
.noneMatch( showing -> showing.startsBefore(now().plusMinutes(15)));
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment