public void UpdateQuality() { foreach (Item item in _items) { switch (item.Name) { case "Aged Brie": _agedBrieService.UpdateQuality(item); break; case "Backstage passes to a TAFKAL80ETC concert": _backstageService.UpdateQuality(item); break; case "Conjured Mana Cake": _conjuredItemService.UpdateQuality(item); break; case "Sulfuras, Hand of Ragnaros": //Ignored break; default: _normalItemService.UpdateQuality(item); break; } } }
public void TestNormalItemService(int sellInShouldBe, int qualityShouldBe, int currentSellIn, int currentQuality) { //Arrange var itemService = new ItemService(); var normalItemService = new NormalItemService(itemService); Item item = new Item() { Name = "+5 Dexterity Vest", SellIn = currentSellIn, Quality = currentQuality }; //Act normalItemService.UpdateQuality(item); //Assert item.SellIn.Should().Be(sellInShouldBe); item.Quality.Should().Be(qualityShouldBe); }