示例#1
0
        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);
        }
示例#2
0
        public ActionResult AdjustQuantity(int newQuantity, TicketType tt)
        {
            CinemaViewModel model = (CinemaViewModel)TempData["model"];

            model.SetTicketQuantity(newQuantity, tt);


            TempData["model"] = model;
            return(RedirectToAction("RateOverview"));
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }