Example #1
0
        /*----------------------------------------------------------------------------------------------*/


        public void CalculateTotalTest3()
        {
            //Arrange
            CartLogic logic = new CartLogic();


            Objects.LogicFees fees = new Objects.LogicFees()
            {
                Tax = .10m, ShippingFee = 10.0m
            };
            decimal ExpectedValue = 2 * 0 + 0 + 10;
            //Act
            decimal Actual = logic.CalculateTotal(null, fees);

            //Assert

            Assert.AreEqual(Actual, ExpectedValue);
        }
Example #2
0
        public void CalculateTotalTest()
        {
            //Arrange
            CartLogic        logic     = new CartLogic();
            List <LogicCart> cartItems = new List <LogicCart>();
            LogicCart        item1     = new LogicCart()
            {
                BrandID = 1, BrandName = "Billy", BrandPhotoURL = "", RetailPrice = 50, CartItemQuantity = 2
            };

            cartItems.Add(item1);
            Objects.LogicFees fees = new Objects.LogicFees()
            {
                Tax = .10m, ShippingFee = 10.0m
            };
            decimal ExpectedValue = 2 * 50 + 10 + 10;
            //Act
            decimal Actual = logic.CalculateTotal(cartItems, fees);

            //Assert

            Assert.AreEqual(Actual, ExpectedValue);
        }