public void QuantityCanBeAdded() { Product product = ProductTestHelper.GetDefault(0); OrderLineItem orderLineItem = new OrderLineItem(product, Quantity); orderLineItem.AddQuantity(3); Assert.AreEqual(8, orderLineItem.Quantity); }
public void LineTotalIsQuantityTimesProductPrice() { Product product = ProductTestHelper.GetDefault(0); product.Price = 12.34m; OrderLineItem orderLineItem = new OrderLineItem(product, Quantity); Assert.AreEqual(product.Price * Quantity, orderLineItem.LineTotal); }
public void QuantityIsInitializedFromConstructor() { OrderLineItem orderLineItem = new OrderLineItem(ProductTestHelper.GetDefault(0), Quantity); Assert.AreEqual(Quantity, orderLineItem.Quantity); }
public void ProductIdAccessorReturnsIdOfProductPassedIntoConstructor() { Product product = ProductTestHelper.GetDefault(3); OrderLineItem orderLineItem = new OrderLineItem(product, Quantity); Assert.AreEqual(3, orderLineItem.ProductId); }