Example #1
0
        public void IsNewMinimalOrderTotalCalculatedCorrectly_True()
        {
            double expectedTotal = ShopInitializer.MerchandiseList[0].Price;

            OrderValidator.CalcTotal(minimalOrder);
            Assert.AreEqual(expectedTotal, minimalOrder.OrderTotal);
        }
Example #2
0
 public void UpdateOrder(Order order)
 {
     if (OrderValidator.IsOrderValid(order))
     {
         OrderValidator.CalcTotal(order);
         context.Entry(order).State = EntityState.Modified;
     }
 }
Example #3
0
 public void CreateOrder(Order order)
 {
     if (OrderValidator.IsOrderValid(order))
     {
         OrderValidator.CalcTotal(order);
         context.Orders.Add(order);
     }
 }
Example #4
0
        public void IsOrderMixedSmallOrderTotalCalculatedCorrectly_True()
        {
            double expectedTotal = 0;

            OrderValidator.CalcTotal(mixedSmallOrder);
            foreach (Merchandise merchandise in mixedSmallOrder.OrdersMerchandise)
            {
                expectedTotal = +merchandise.Price;
            }
            Assert.AreEqual(expectedTotal, mixedSmallOrder.OrderTotal);
        }