/** Compute the total price of all tickets in this booking. */ public float getTotalTicketPrice() { float totalPrice = 0.0f; for (Ticket ticket : tickets) { totalPrice += (ticket.getPrice()); } return totalPrice; }
@Test public void testGetPrice() { Ticket t1 = new WalkupTicket(111); Assert.assertEquals(50.0, t1.getPrice(), 0); }