public void SQL_PercentOffItem_ShouldReturn_BackPack1_And_5_For_Amount_Off() { SqlIncentiveRepository repo = new SqlIncentiveRepository(); List<Incentive> incentives = repo.GetIncentives().ToList(); AmountOffItemCoupon coupon = (AmountOffItemCoupon)incentives[3].Coupon; Assert.AreEqual("Backpack1", coupon.ProductCodes[0]); Assert.AreEqual(5, coupon.AmountOff); }
public void SQL_Incentives_Should_Return_Proper_Coupon_Types() { SqlIncentiveRepository repo = new SqlIncentiveRepository(); List<Incentive> incentives = repo.GetIncentives().ToList(); Assert.IsInstanceOfType(incentives[0].Coupon, typeof(PercentOffOrderCoupon)); Assert.IsInstanceOfType(incentives[1].Coupon, typeof(PercentOffItemCoupon)); Assert.IsInstanceOfType(incentives[2].Coupon, typeof(AmountOffOrderCoupon)); Assert.IsInstanceOfType(incentives[3].Coupon, typeof(AmountOffItemCoupon)); }
public void SQL_PercentOffItem_ShouldReturn_10_for_AmountOff_for_Incentive_2() { SqlIncentiveRepository repo = new SqlIncentiveRepository(); List<Incentive> incentives = repo.GetIncentives().ToList(); AmountOffOrderCoupon coupon = (AmountOffOrderCoupon)incentives[2].Coupon; Assert.AreEqual(10, coupon.AmountOff); }
public void SQL_Incentives_Should_LoadFrom_DB() { SqlIncentiveRepository repo = new SqlIncentiveRepository(); List<Incentive> incentives = repo.GetIncentives().ToList(); Assert.AreEqual(4, incentives.Count); }