public void ShouldIncreaseQualityBy3WhenItemNameIsBackstagePassesAndSellInLessThen6() { var firstItem = new Item { Name = "Backstage passes to a TAFKAL80ETC concert", Quality = 40, SellIn = 5 }; var items = new[] { firstItem }; var target = new GildedRose(items); target.UpdateQuality(); Assert.AreEqual(43, firstItem.Quality); }
public void ShouldLowerQualityTwiceWhenSellInValueIsLowerThanZero() { var firstItem = new Item { Name = "Test", Quality = 5, SellIn = -1 }; var secondItem = new Item { Name = "Test2", Quality = 10, SellIn = 0 }; var items = new[] { firstItem, secondItem }; var target = new GildedRose(items); target.UpdateQuality(); Assert.AreEqual(3, firstItem.Quality); Assert.AreEqual(8, secondItem.Quality); }
public void ShouldIncreaseQualityOnSellInDecreaseWhenItemNameEqualsToAgedBrie() { var firstItem = new Item { Name = "Aged Brie", Quality = 12, SellIn = 3 }; var secondItem = new Item { Name = "Aged Brie", Quality = 10, SellIn = 0 }; var items = new[] { firstItem, secondItem }; var target = new GildedRose(items); target.UpdateQuality(); Assert.AreEqual(13, firstItem.Quality); Assert.AreEqual(12, secondItem.Quality); }
public void ShouldLowerSellInValue() { var firstItem = new Item {Name = "Test", Quality = 5, SellIn = 3}; var secondItem = new Item {Name = "Test2", Quality = 10, SellIn = 0}; var items = new[] {firstItem, secondItem}; var target = new GildedRose(items); target.UpdateQuality(); Assert.AreEqual(2, firstItem.SellIn); Assert.AreEqual(-1, secondItem.SellIn); }
public void ShouldSetQualityToZeroWhenItemNameIsBackstagePassesAndSellInValueWentLessThan1() { var firstItem = new Item { Name = "Backstage passes to a TAFKAL80ETC concert", Quality = 40, SellIn = 0 }; var items = new[] { firstItem }; var target = new GildedRose(items); target.UpdateQuality(); Assert.AreEqual(0, firstItem.Quality); }
public void ShouldNeverIncreaseQualityToMoreThan50() { var firstItem = new Item { Name = "Aged Brie", Quality = 50, SellIn = 3 }; var items = new[] { firstItem }; var target = new GildedRose(items); target.UpdateQuality(); Assert.AreEqual(50, firstItem.Quality); }
public void ShouldNeverDropQualityLessThanZero() { var firstItem = new Item { Name = "Test", Quality = 0, SellIn = 0 }; var secondItem = new Item { Name = "Test2", Quality = 1, SellIn = 0 }; var items = new[] { firstItem, secondItem }; var target = new GildedRose(items); target.UpdateQuality(); Assert.AreEqual(0, firstItem.Quality); Assert.AreEqual(0, secondItem.Quality); }
public void ShouldNeverChangeSellInOfItemWithNameSulfurus() { var firstItem = new Item { Name = "Sulfuras, Hand of Ragnaros", Quality = 80, SellIn = 3 }; var items = new[] { firstItem }; var target = new GildedRose(items); target.UpdateQuality(); Assert.AreEqual(3, firstItem.SellIn); }