public virtual void Add(Product product, decimal quantity) { var item = product.ToPurchaseItem(); item.Quantity = quantity; item.UnitPrice = product.UnitPrice; item.VatRate = product.VatRate; Items.Add(item); }
public static IList<Product> CreateValid(int numOfProducts) { var products = new List<Product>(numOfProducts); var maxUnitPrice = numOfProducts*10; for (var c = 0; c < numOfProducts; c++) { var product = new Product { ProductNo = "#" + c, Name = "The Name #" + c, Description = "The Description #" + c, UnitPrice = (decimal) (maxUnitPrice - (0.25*c)), VatRate = 0.25m }; products.Add(product); } return products; }