public void QualityNeverMoreThan50() { IList <Item> Items = new List <Item> { new Item { Name = "Aged Brie", SellIn = 25, Quality = 50 } }; GildedRose app = new GildedRose(Items); UpdateQualityAndCheckItem(app, Items[0], 24, 50); Items = new List <Item> { new Item { Name = "Aged Brie", SellIn = -1, Quality = 48 } }; app = new GildedRose(Items); UpdateQualityAndCheckItem(app, Items[0], -2, 50); }
public void BackstagePassesAreSpecial() { IList <Item> Items = new List <Item> { new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 11, Quality = 15 } }; GildedRose app = new GildedRose(Items); UpdateQualityAndCheckItem(app, Items[0], 10, 16); UpdateQualityAndCheckItem(app, Items[0], 9, 18); UpdateQualityAndCheckItem(app, Items[0], 8, 20); UpdateQualityAndCheckItem(app, Items[0], 7, 22); UpdateQualityAndCheckItem(app, Items[0], 6, 24); UpdateQualityAndCheckItem(app, Items[0], 5, 26); UpdateQualityAndCheckItem(app, Items[0], 4, 29); UpdateQualityAndCheckItem(app, Items[0], 3, 32); UpdateQualityAndCheckItem(app, Items[0], 2, 35); UpdateQualityAndCheckItem(app, Items[0], 1, 38); UpdateQualityAndCheckItem(app, Items[0], 0, 41); UpdateQualityAndCheckItem(app, Items[0], -1, 0); }
private static void UpdateQualityAndCheckItem(GildedRose app, Item item, int expectedSellIn, int expectedQuality) { app.UpdateQuality(); Assert.AreEqual(expectedSellIn, item.SellIn); Assert.AreEqual(expectedQuality, item.Quality); }