Skip to content

Instantly share code, notes, and snippets.

@jasongorman

jasongorman/VideoTests.java Secret

Created Mar 18, 2020
Embed
What would you like to do?
@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
You can’t perform that action at this time.