コード例 #1
0
ファイル: Booking.java プロジェクト: Massiv-IO/ticket-monster
 /** 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;
 }
コード例 #2
0
  @Test
  public void testGetPrice() {

    Ticket t1 = new WalkupTicket(111);
    Assert.assertEquals(50.0, t1.getPrice(), 0);
  }