Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created March 18, 2020 08:24
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 jasongorman/5e155be77178a020c96f89d98dd6b46b to your computer and use it in GitHub Desktop.
Save jasongorman/5e155be77178a020c96f89d98dd6b46b to your computer and use it in GitHub Desktop.
@Test(expected=CustomerUnderageException.class)
public void customerMustBeOverTwelveToRentAVideoRatedTwelve() throws Exception {
Customer customer = new Customer(null, null, "2012-01-01");
Video video = new Video(null, Rating.TWELVE);
video.rentFor(customer);
}
@Test
public void videoRentedByCustomerOfLegalAgeIsAddedToCustomersRentedVideos() throws Exception {
Customer customer = new Customer(null, null, "1964-01-01");
Video video = new Video(null, Rating.TWELVE);
video.rentFor(customer);
assertTrue(customer.getRentedVideos().contains(video));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment