Esempio n. 1
0
        public int ApplyDiscount(ref IList <Item> itemsLeft)
        {
            var itemDiscounted = itemsLeft.Where(item => Skus.Contains(item.Sku)).OrderByDescending(item => item.Price).Take(MatchingQuantity).ToList();

            foreach (var item in itemDiscounted)
            {
                itemsLeft.Remove(item);
            }
            return(itemDiscounted.Sum(item => item.Price) - ForfaitPrice);
        }
Esempio n. 2
0
 public bool CanApplyTo(IList <Item> itemsLeft)
 {
     return(itemsLeft.Count(item => Skus.Contains(item.Sku)) >= MatchingQuantity);
 }
Esempio n. 3
0
 public bool AppliesTo(char x)
 {
     return(Skus.Contains(x));
 }