Ejemplo n.º 1
0
        // GET: Movies/Cart/5
        public ActionResult Cart(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Movies movies = db.Movies.Find(id);

            if (movies == null)
            {
                return(HttpNotFound());
            }
            ////ViewBag.Tax = moviesTable.Price * 0.08;  //Replace with call to .Business project

            //TaxCalculate cl = new TaxCalculate();
            //ViewBag.Tax = cl.GetTaxCalc(movies.Price);
            //ViewBag.TotalPrice = cl.TotPrice(movies.Price);

            //return View("~/Views/Movies/Cart.cshtml", movies);  OR
            MovieVm vm = new MovieVm();

            vm.ID    = movies.ID;
            vm.Title = movies.Title;
            vm.Year  = movies.Year;
            vm.Price = movies.Price;
            TaxCalculate cl = new TaxCalculate();

            vm.Tax   = cl.GetTaxCalc(movies.Price);
            vm.Total = cl.TotPrice(movies.Price);
            return(View(vm));
        }
Ejemplo n.º 2
0
        public void GetTaxFail()
        {
            //Arrange
            var Tc = new TaxCalculate();

            //Act
            var taxAmt = Tc.GetTaxCalc(100);

            //Assert
            Assert.AreNotEqual(taxAmt, 8.1);
        }
Ejemplo n.º 3
0
        public void GetTaxPass()
        {
            //Arrange
            var Tc = new TaxCalculate();

            //Act
            var taxAmt = Tc.GetTaxCalc(100);

            //Assert
            Assert.AreEqual(taxAmt, 8.00);
        }