public void Scenario1_NoOffer()
        {
            List <ProductCheckout> orderCart = new List <ProductCheckout>()
            {
                new ProductCheckout()
                {
                    ProductCode = "A", Quantity = 1, DefaultPrice = 50
                }, new ProductCheckout()
                {
                    ProductCode = "B", Quantity = 1, DefaultPrice = 30
                }, new ProductCheckout()
                {
                    ProductCode = "C", Quantity = 1, DefaultPrice = 20
                }
            };
            double expectedValue = 100;
            double actualValue   = promotionService.ApplyPromotion(orderCart, _promotions).TotalPrice;

            Assert.AreEqual(expectedValue, actualValue);
        }
Example #2
0
 internal bool ApplyPromotion()
 {
     try
     {
         appliedOffer = promotionService.ApplyPromotion(checkoutList, GetProductOffers());
         return(true);
     }
     catch (Exception ex)
     {
         LogWriter.LogWrite("Error in  Applying Promotio :" + ex.Message);
     }
     return(false);
 }