public void IsNewMinimalOrderTotalCalculatedCorrectly_True() { double expectedTotal = ShopInitializer.MerchandiseList[0].Price; OrderValidator.CalcTotal(minimalOrder); Assert.AreEqual(expectedTotal, minimalOrder.OrderTotal); }
public void UpdateOrder(Order order) { if (OrderValidator.IsOrderValid(order)) { OrderValidator.CalcTotal(order); context.Entry(order).State = EntityState.Modified; } }
public void CreateOrder(Order order) { if (OrderValidator.IsOrderValid(order)) { OrderValidator.CalcTotal(order); context.Orders.Add(order); } }
public void IsOrderMixedSmallOrderTotalCalculatedCorrectly_True() { double expectedTotal = 0; OrderValidator.CalcTotal(mixedSmallOrder); foreach (Merchandise merchandise in mixedSmallOrder.OrdersMerchandise) { expectedTotal = +merchandise.Price; } Assert.AreEqual(expectedTotal, mixedSmallOrder.OrderTotal); }