public void TestUpdateItemsList()
        {
            UpdateQualityService.UpdateQuality(_items);

            for (var i = 0; i < _items.Count; i++)
            {
                Assert.True(_items[i].Quality == _newItems[i].Quality);
                Assert.True(_items[i].SellIn == _newItems[i].SellIn);
            }
        }
Exemplo n.º 2
0
        public void TestDexterityQualityTo0(int sellIn, int quality)
        {
            var item = new Item {
                Name = "+5 Dexterity Vest", SellIn = sellIn, Quality = quality
            };

            UpdateQualityService.UpdateQuality(item);

            Assert.True(item.SellIn == sellIn - 1);
            Assert.True(item.Quality == 0);
        }
Exemplo n.º 3
0
        public void TestAgedBrie(int sellIn, int quality)
        {
            var item = new Item {
                Name = "Aged Brie", SellIn = sellIn, Quality = quality
            };

            UpdateQualityService.UpdateQuality(item);

            Assert.True(item.SellIn == sellIn - 1);
            Assert.True(item.Quality == quality + 1);
        }
        public void TestConjured(int sellIn, int quality)
        {
            var item = new Item {
                Name = "Conjured Mana Cake", SellIn = sellIn, Quality = quality
            };

            UpdateQualityService.UpdateQuality(item);

            Assert.True(item.SellIn == sellIn - 1);
            Assert.True(item.Quality == quality - 2);
        }
        public void TestSulfuras()
        {
            var item = new Item {
                Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80
            };

            UpdateQualityService.UpdateQuality(item);

            Assert.True(item.SellIn == 0);
            Assert.True(item.Quality == 80);
        }
        public void TestElixirQualityTo0(int sellIn, int quality)
        {
            var item = new Item {
                Name = "Elixir of the Mongoose", SellIn = sellIn, Quality = quality
            };

            UpdateQualityService.UpdateQuality(item);

            Assert.True(item.SellIn == sellIn - 1);
            Assert.True(item.Quality == 0);
        }
        public void TestBackstageConcertSellInLowerThan0(int sellIn)
        {
            var item = new Item {
                Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = sellIn, Quality = 6
            };

            UpdateQualityService.UpdateQuality(item);

            Assert.True(item.SellIn == sellIn - 1);
            Assert.True(item.Quality == 0);
        }
        public void TestBackstageConcertQualityTo50(int sellIn, int quality)
        {
            var item = new Item
            {
                Name    = "Backstage passes to a TAFKAL80ETC concert",
                SellIn  = sellIn,
                Quality = quality
            };

            UpdateQualityService.UpdateQuality(item);

            Assert.True(item.SellIn == sellIn - 1);
            Assert.True(item.Quality == 50);
        }