public void WillNotProvideSpecialPriceWhenNotEnoughQty() { Dictionary<string, int> sales = new Dictionary<string, int>(); sales.Add("A:3", 130); PriceRules specialRules = new PriceRules(sales); Assert.IsNull(specialRules.PriceCheck("A", 1)); }
public void WillProvideSpecialPriceWhenEnoughQty(string sku, int qty, int sPrice) { Dictionary<string, int> sales = new Dictionary<string, int>(); sales.Add(String.Format("{0}:{1}", sku, qty), sPrice); PriceRules specialRules = new PriceRules(sales); Assert.AreEqual(specialRules.PriceCheck(sku, qty), sPrice); }
public void WillProvideSpecialPriceWhenEnoughQty() { Dictionary<string, int> sales = new Dictionary<string, int>(); sales.Add(String.Format("{0}:{1}", "A", 3), 130); sales.Add(String.Format("{0}:{1}", "B", 2), 45); PriceRules specialRules = new PriceRules(sales); Assert.AreEqual(specialRules.PriceCheck("A", 3), 130); Assert.AreEqual(specialRules.PriceCheck("B", 2), 45); }
public void WillNotProvideSpecialWhenNotOnSale() { Dictionary<string, int> sales = new Dictionary<string, int>(); PriceRules specialRules = new PriceRules(sales); Assert.IsNull(specialRules.PriceCheck("A", 1)); }