public void UninitializedBreakList_GetMaxOrderableQty() //should always be 0 since there's 0 stock { var tmp = new BaseOrderable(); Assert.AreEqual(0L, tmp.GetMaxOrderableQty()); foreach (int i in allRandIntRanges) { Assert.AreEqual(0L, tmp.GetMaxOrderableQty(i)); } }
public ResolverMatrix(BaseOrderable part, long qty) { ID = part.ID; MaxOrderable = part.GetMaxOrderableQty(qty); MinAdjustment = part.GetMinimumAmountToFulfillInterval(qty); UnitCost = part.GetUnitPriceForQty(MaxOrderable); TotalCost = UnitCost * MaxOrderable; isMOQ1 = part.QtyInterval == 1; }
public void BreakList_GetMaxOrderableQty_NoMin_NoInt() { foreach (var i in allRandIntRanges) { if (i <= 0) { Assert.AreEqual(0L, testTarget.GetMaxOrderableQty(i)); } if (i <= testTarget.QtyStock) { Assert.AreEqual(i, testTarget.GetMaxOrderableQty(i)); } else if (i > testTarget.QtyStock) { Assert.AreEqual(testTarget.QtyStock, testTarget.GetMaxOrderableQty(i)); } } }