Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public ActionResult AdjustQuantity(int newQuantity, TicketType tt)
        {
            CinemaViewModel model = (CinemaViewModel)TempData["model"];

            model.SetTicketQuantity(newQuantity, tt);


            TempData["model"] = model;
            return(RedirectToAction("RateOverview"));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }