public void UpdateQuality()
 {
     foreach (var item in _items)
     {
         SellInStrategyFactory.Create(item.Name).UpdateSellIn(item);
         QualityStrategyFactory.Create(item.Name).UpdateQuality(item, item.SellIn < 0);
     }
 }
        private static void UpdateItem(Item item)
        {
            var sellInStrategy = SellInStrategyFactory.GetStrategy(item);

            sellInStrategy.UpdateSellIn(item);

            var qualityStrategy = QualityStrategyFactory.GetStrategy(item);

            qualityStrategy.UpdateQuality(item);
        }
Example #3
0
        public void GetStrategyReturnsAgedBrieQualityStrategyForAgedBrie()
        {
            var strategy = SellInStrategyFactory.GetStrategy(new LegendaryItem());

            Assert.IsInstanceOfType(strategy, typeof(SulfurasSellInStrategy));
        }
Example #4
0
        public void GetStrategyReturnsNormalQualityStrategyForNormalItem()
        {
            var strategy = SellInStrategyFactory.GetStrategy(new Item());

            Assert.IsInstanceOfType(strategy, typeof(DefaultSellInStrategy));
        }