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); }
public void GetStrategyReturnsAgedBrieQualityStrategyForAgedBrie() { var strategy = SellInStrategyFactory.GetStrategy(new LegendaryItem()); Assert.IsInstanceOfType(strategy, typeof(SulfurasSellInStrategy)); }
public void GetStrategyReturnsNormalQualityStrategyForNormalItem() { var strategy = SellInStrategyFactory.GetStrategy(new Item()); Assert.IsInstanceOfType(strategy, typeof(DefaultSellInStrategy)); }