Exemplo n.º 1
0
        public void UpgradeReturnsNewItem()
        {
            var item = new Item {
                SellIn = 10, Quality = 10
            };
            var result = _itemUpgrade.Upgrade(item);

            Assert.That(item, Is.Not.SameAs(result));
        }
Exemplo n.º 2
0
        protected override Item UpdateItemQuality(Item item)
        {
            foreach (var x in _itemUpgrades.Where(x => x.IsMatch(item)))
            {
                return(x.Upgrade(item));
            }

            return(_defaultStrategy.Upgrade(item));
        }