예제 #1
0
        public void getSalePriceWithDiscount()
        {
            int        percentage = 50;
            List <int> lst        = new List <int>();

            lst.Add(milkInStore.getProductInStoreId());
            discountsArchive.addNewDiscounts(1, lst, null, percentage, "20/6/2020", "");
            double price  = 200;
            int    amount = 5;

            sale = new Sale(1, milkInStore.getProductInStoreId(), 1, 50, "20/5/2020");
            double check = sale.getPriceAfterDiscount(amount);
            double res   = (price * amount) - ((((Double)(price * amount * percentage)) / 100));

            Assert.AreEqual(res, check);
        }