public void Between1KAnd2KTest() { Assert.IsTrue(_util.Between1KAnd2K(2000)); Assert.IsTrue(_util.Between1KAnd2K(1999)); Assert.IsTrue(_util.Between1KAnd2K(1001)); Assert.IsFalse(_util.Between1KAnd2K(1000)); }
public Discount GetBigSpenderDiscount(AccountHistory customerAccount) { var discountType = DiscountType.BigSpenderDiscount; decimal discountValue; if (_util.SpendOver5K(customerAccount.YearlySpend)) { discountValue = 2; } else if (_util.Between2KAnd5K(customerAccount.YearlySpend)) { discountValue = 1; } else if (_util.Between1KAnd2K(customerAccount.YearlySpend)) { discountValue = 0.5M; } else { if (_util.Between500And1K(customerAccount.YearlySpend)) { discountValue = 0.25M; } else { discountType = DiscountType.None; discountValue = 0; } } return(new Discount { DiscountType = discountType, DiscountValue = discountValue }); }