public void How_Many_Tickets_Needed() { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(3, TicketTypes.AdultTicket); Assert.AreEqual(3, register.NumberOfTickets()); }
private void ResetCalculator() { register = new TicketPriceCalculator(); _numberOfAdultTickets = 0; _numberOfChildTickets = 0; _numberOfSeniorTickets = 0; LblGroupDiscount.Text = null; }
public void One_senior_and_one_child_ticket_costs_13_5() { DateTime nonMatinee = Convert.ToDateTime("3:00 PM"); using (Time.FreezeAt(nonMatinee)) { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(1, TicketTypes.SeniorTicket); register.NumTicketsNeeded(1, TicketTypes.ChildTicket); Assert.AreEqual(13.5m, register.TransactionTotal()); } }
public void Two_seniors_and_one_adult_cost_27_dollars() { DateTime nonMatinee = Convert.ToDateTime("3:00 PM"); using (Time.FreezeAt(nonMatinee)) { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(2, TicketTypes.SeniorTicket); register.NumTicketsNeeded(1, TicketTypes.AdultTicket); Assert.AreEqual(27, register.TransactionTotal()); } }
public void Children_cost_5_dollars_fifty_cents() { DateTime nonMatinee = Convert.ToDateTime("3:00 PM"); using (Time.FreezeAt(nonMatinee)) { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(1, TicketTypes.ChildTicket); Assert.AreEqual(5.5m, register.TransactionTotal()); } }
public void Regular_adult_costs_11_dollars() { DateTime nonMatinee = Convert.ToDateTime("3:00 PM"); using (Time.FreezeAt(nonMatinee)) { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(1, TicketTypes.AdultTicket); Assert.AreEqual(11, register.TransactionTotal()); } }
public void Is_Group_Price_Applicable() { DateTime nonMatinee = Convert.ToDateTime("3:00 PM"); using (Time.FreezeAt(nonMatinee)) { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(6, TicketTypes.AdultTicket); Assert.AreEqual(true, register.IsGroupPriceApplicable()); } }
public void Six_seniors_cost_42_dollars() { DateTime nonMatinee = Convert.ToDateTime("3:00 PM"); using (Time.FreezeAt(nonMatinee)) { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(6, TicketTypes.SeniorTicket); Assert.AreEqual(42, register.TransactionTotal()); } }
public void Three_adults_and_two_kids_cost_44_dollars() { DateTime nonMatinee = Convert.ToDateTime("3:00 PM"); using (Time.FreezeAt(nonMatinee)) { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(3, TicketTypes.AdultTicket); register.NumTicketsNeeded(2, TicketTypes.ChildTicket); Assert.AreEqual(44, register.TransactionTotal()); } }
public void Three_adult_Three_Seniors_Two_child_matinee_tickets_cost_dollars() { DateTime matineeTime = Convert.ToDateTime("1:00 PM"); using (Time.FreezeAt(matineeTime)) { var register = new TicketPriceCalculator(); register.NumTicketsNeeded(3, TicketTypes.AdultTicket); register.NumTicketsNeeded(3, TicketTypes.SeniorTicket); register.NumTicketsNeeded(2, TicketTypes.ChildTicket); Assert.AreEqual(52, register.TransactionTotal()); } }
public Calc() { InitializeComponent(); register = new TicketPriceCalculator(); }