public void GetAllTickektsQuantityTest() { //arrange var model = new CinemaViewModel(); int quantity = 2; TicketType tt = model.StudentTicketOrder.GetTicketType(); TicketType ttSenior = model.SeniorTicketOrder.GetTicketType(); //act model.SetTicketQuantity(quantity, tt); model.SetTicketQuantity(quantity, ttSenior); int allTickets = model.GetAllTicketsQuantity(); //assert Assert.AreEqual(4, allTickets); }
public ActionResult AdjustQuantity(int newQuantity, TicketType tt) { CinemaViewModel model = (CinemaViewModel)TempData["model"]; model.SetTicketQuantity(newQuantity, tt); TempData["model"] = model; return(RedirectToAction("RateOverview")); }
public void TestSetTicketQuanityChild() { //arrange var model = new CinemaViewModel(); int quantity = 2; TicketType tt = new ChildTicketOrder(model).GetTicketType(); //act model.SetTicketQuantity(quantity, tt); //assert Assert.AreEqual(2, model.ChildTicketOrder.Quantity); }
public void TestSetTicketQuantityStudent() { //arrange var model = new CinemaViewModel(); int quantity = 2; TicketType tt = model.StudentTicketOrder.GetTicketType(); //act model.SetTicketQuantity(quantity, tt); //assert Assert.AreEqual(2, model.StudentTicketOrder.Quantity); }