Esempio n. 1
0
        public void IncreaseQualityByTwoForExpiredAgedBrie()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Aged Brie", SellIn = 0, Quality = 20
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(22, items.First().Quality);
        }
Esempio n. 2
0
        public void IncreaseQualityByThreeForBackstagePass()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 5, Quality = 20
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(23, items.First().Quality);
        }
Esempio n. 3
0
        public void ReduceQualityTwiceAsFastAfterExpired()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Normal Item", SellIn = 0, Quality = 20
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(18, items.First().Quality);
        }
Esempio n. 4
0
        public void NeverMakeQualityNegative()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Normal Item", SellIn = 15, Quality = 0
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(0, items.First().Quality);
        }
Esempio n. 5
0
        public void DecreaseQualityByFourForConjuredAfterExpired()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Conjured Mana Cake", SellIn = 0, Quality = 30
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(26, items.First().Quality);
        }
Esempio n. 6
0
        public void LimitQualityAtFifty()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Aged Brie", SellIn = 15, Quality = 50
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(50, items.First().Quality);
        }
Esempio n. 7
0
        public void ReduceQualityByOneForNormalItem()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Normal Item", SellIn = 15, Quality = 20
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(19, items.First().Quality);
        }
Esempio n. 8
0
        public void DropQualityToZeroForExpiredBackstagePass()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 0, Quality = 20
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(0, items.First().Quality);
        }
Esempio n. 9
0
        public void KeepSulfurasQualityAndSellInDateConstant()
        {
            var items = new List <Item> {
                new Item {
                    Name = "Sulfuras, Hand of Ragnaros", SellIn = 15, Quality = 80
                }
            };
            var app = new GildedRose(items);

            app.UpdateInventory();
            Assert.AreEqual(80, items.First().Quality);
            Assert.AreEqual(15, items.First().SellIn);
        }