String statement = customer2.statement();
assertEquals(expected, statement);
}
public void testStatementForManyMovies() {
Customer customer1 = new Customer("David");
Movie movie1 = new Movie("Madagascar", Movie.CHILDRENS);
Rental rental1 = new Rental(movie1, 6); // 6 day rental
Movie movie2 = new Movie("Star Wars", Movie.NEW_RELEASE);
Rental rental2 = new Rental(movie2, 2); // 2 day rental
Movie movie3 = new Movie("Gone with the Wind", Movie.REGULAR);
Rental rental3 = new Rental(movie3, 8); // 8 day rental
customer1.addRental(rental1);
customer1.addRental(rental2);
customer1.addRental(rental3);
String expected = "Rental Record for David\n" +
"\tMadagascar\t6.0\n" +
"\tStar Wars\t6.0\n" +
"\tGone with the Wind\t11.0\n" +
"Amount owed is 23.0\n" +
"You earned 4 frequent renter points";
String statement = customer1.statement();
assertEquals(expected, statement);
}