public void AddSalesFulfillmentTestSingleSale() { ProductMasterItem master = new ProductMasterItem(1, "Code1", "", 48, 92, .5, "OM", 40, 100, "", true, "", "", 0, 0, 0, 0); StaticInventoryTracker.ProductMasterList.Clear(); StaticInventoryTracker.ProductMasterList.Add(master); var sale = new SalesItem(master, "1001", 100, 0, "D", DateTime.Today); StaticInventoryTracker.SalesItems.Add(sale); ScheduleGenerator.AddSalesFulfillment(master, 60); Assert.AreEqual(60, sale.Fulfilled); }
public void AddSalesFulfillmentTestMultipleSale() { ProductMasterItem master = new ProductMasterItem(1, "Code1", "", 48, 92, .5, "OM", 40, 100, "", true, "", "", 0, 0, 0, 0); StaticInventoryTracker.ProductMasterList.Clear(); StaticInventoryTracker.ProductMasterList.Add(master); var sale = new SalesItem(master, "1001", 100, 0, "D", DateTime.Today); var sale2 = new SalesItem(master, "1002", 300, 0, "D", DateTime.Today.AddDays(1)); // should fill last StaticInventoryTracker.SalesItems.Add(sale); StaticInventoryTracker.SalesItems.Add(sale2); ScheduleGenerator.AddSalesFulfillment(master, 260); Assert.AreEqual(100, sale.Fulfilled); Assert.AreEqual(160, sale2.Fulfilled); }