Exemple #1
0
        public void Aged_Item_Quality_Should_Increase_The_Older_It_Gets_Twice_As_Fast_After_Sell_Date()
        {
            // Arrange
            var agedItem = new AgedItem("Aged Brie", 0, 0);

            // Act
            agedItem.UpdateQuality();

            // Assert
            Assert.AreEqual(agedItem.Quality, 2);
        }
Exemple #2
0
        public void Aged_Item_Quality_Should_Increase_The_Older_It_Gets()
        {
            // Arrange
            var agedItem = new AgedItem("Aged Brie", 2, 0);

            // Act
            agedItem.UpdateQuality();

            // Assert
            Assert.AreEqual(agedItem.Quality, 1);
            Assert.AreEqual(agedItem.SellIn, 1);
        }
Exemple #3
0
        public void The_Quality_Of_An_Item_Should_Never_Be_More_Than_50_For_BackStage_And_Aged_Items()
        {
            // Arrange
            var backstageItem = new BackstageItem("Backstage passes to a TAFKAL80ETC concert", 20, 50);
            var agedItem      = new AgedItem("Aged Brie", 2, 50);

            // Act
            backstageItem.UpdateQuality();
            agedItem.UpdateQuality();

            // Assert
            Assert.AreEqual(backstageItem.Quality, 50);
            Assert.AreEqual(agedItem.Quality, 50);
        }
Exemple #4
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);
        }