Пример #1
0
        public void Updating_Legendary_Item_Quality_Should_Not_Decrease()
        {
            // Arrange
            var legendaryItem = new  LegendaryItem("Sulfuras, Hand of Ragnaros", 0, 80);

            // Act
            legendaryItem.UpdateQuality();

            // Assert
            Assert.AreEqual(legendaryItem.Quality, 80);
            Assert.AreEqual(legendaryItem.SellIn, 0);
        }
Пример #2
0
        public void LegendaryItemUpdateQualityTest()
        {
            var item = new LegendaryItem()
            {
                Quality = 80,
                SellIn  = 0
            };

            item.UpdateQuality();

            Assert.IsTrue(item.Quality == 80 && item.SellIn == -1);
        }
Пример #3
0
        public void Updating_The_Quality_Of_An_Item_Should_Never_Be_Negative()
        {
            // Arrange
            var commonItem    = new CommonItem("+5 Dexterity Vest", 0, 0);
            var backstageItem = new BackstageItem("Backstage passes to a TAFKAL80ETC concert", 20, 0);
            var agedItem      = new AgedItem("Aged Brie", 2, 0);
            var conjuredItem  = new ConjuredItem("Conjured Mana Cake", 3, 0);
            var legendaryItem = new LegendaryItem("Sulfuras, Hand of Ragnaros", 0, 80);

            // Act
            commonItem.UpdateQuality();
            backstageItem.UpdateQuality();
            agedItem.UpdateQuality();
            conjuredItem.UpdateQuality();
            legendaryItem.UpdateQuality();

            // Assert
            Assert.AreEqual(commonItem.Quality, 0);
            Assert.AreEqual(backstageItem.Quality, 1);
            Assert.AreEqual(agedItem.Quality, 1);
            Assert.AreEqual(conjuredItem.Quality, 0);
            Assert.AreEqual(legendaryItem.Quality, 80);
        }