public void sulfurasSellInDoesNotDecreaseAfterADay()
        {
            Sulfuras   item = Sulfuras.Create(sellIn: 5, quality: 20);
            GildedRose app  = new GildedRose(item);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(5, item.SellIn);
        }
        public void decreaseConjuredQualityTwiceAfterADay()
        {
            Conjured   item = Conjured.Create(name: "Conjured", sellIn: 5, quality: 20);
            GildedRose app  = new GildedRose(item);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(4, item.SellIn);
            Assert.AreEqual(18, item.Quality);
        }
Beispiel #3
0
        public void sulfurasSellInDoesNotDecreaseAfterADay()
        {
            items.Add(new Sulfuras {
                Name = "Sulfuras", SellIn = 5, Quality = 20
            });
            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();
            Assert.AreEqual(5, items[0].SellIn);
        }
        public void decrementNormalItemQualityOnceAfterADay()
        {
            EditableItem item = EditableItem.Create("Berger", sellIn: 2, quality: 5);
            GildedRose   app  = new GildedRose(item);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(4, item.Quality);
            Assert.AreEqual(1, item.SellIn);
        }
        public void decreaseConjuredQualityFourTimesAfterADayWhenExceededSellInDays()
        {
            Conjured   item = Conjured.Create(name: "Conjured", sellIn: 0, quality: 20);
            GildedRose app  = new GildedRose(item);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(-1, item.SellIn);
            Assert.AreEqual(16, item.Quality);
        }
        public void incrementAgedBrieQualityTwiceAfterADayWhenExceededSellInDays()
        {
            AgedBrie   item = AgedBrie.Create(sellIn: -1, quality: 10);
            GildedRose app  = new GildedRose(item);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(12, item.Quality);
            Assert.AreEqual(-2, item.SellIn);
        }
        public void incrementConcertPassQualityThriceAfterADayWhenSellInDaysLessThan10()
        {
            ConcertBackstagePass item =
                ConcertBackstagePass.Create(concertName: "Backstage Pass", sellIn: 5, quality: 20);
            GildedRose app = new GildedRose(item);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(23, item.Quality);
            Assert.AreEqual(4, item.SellIn);
        }
Beispiel #8
0
        public void incrementConcertPassQualityThriceAfterADayWhenSellInDaysLessThan10()
        {
            items.Add(new ConcertBackstagePass {
                Name = "Backstage Pass", SellIn = 5, Quality = 20
            });
            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();
            Assert.AreEqual(23, items[0].Quality);
            Assert.AreEqual(4, items[0].SellIn);
        }
Beispiel #9
0
        public void incrementAgedBrieQualityTwiceAfterADayWhenExceededSellInDays()
        {
            items.Add(new AgedBrie {
                Name = "Aged Brie", SellIn = -1, Quality = 10
            });
            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();
            Assert.AreEqual(12, items[0].Quality);
            Assert.AreEqual(-2, items[0].SellIn);
        }
Beispiel #10
0
        public void decrementNormalItemQualityOnceAfterADay()
        {
            items.Add(new EditableItem {
                Name = "Berger", SellIn = 2, Quality = 5
            });
            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();
            Assert.AreEqual(4, items[0].Quality);
            Assert.AreEqual(1, items[0].SellIn);
        }
Beispiel #11
0
        public void decreaseConjuredQualityFourTimesAfterADayWhenExceededSellInDays()
        {
            items.Add(new Conjured {
                Name = "Conjured", SellIn = 0, Quality = 20
            });
            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();
            Assert.AreEqual(-1, items[0].SellIn);
            Assert.AreEqual(16, items[0].Quality);
        }
Beispiel #12
0
        public void decreaseConjuredQualityTwiceAfterADay()
        {
            items.Add(new Conjured {
                Name = "Conjured", SellIn = 5, Quality = 20
            });
            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();
            Assert.AreEqual(4, items[0].SellIn);
            Assert.AreEqual(18, items[0].Quality);
        }
        public void zeroOutConcertPassQualityAfterADayWhenExceededSellInDays()
        {
            ConcertBackstagePass item =
                ConcertBackstagePass.Create(concertName: "Backstage Pass", sellIn: -1, quality: 0);
            GildedRose app = new GildedRose(item);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(0, item.Quality);
            Assert.AreEqual(-2, item.SellIn);
        }
Beispiel #14
0
        public void zeroOutConcertPassQualityAfterADayWhenExceededSellInDays()
        {
            items.Add(new ConcertBackstagePass {
                Name = "Backstage Pass", SellIn = -1, Quality = 0
            });
            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();
            Assert.AreEqual(0, items[0].Quality);
            Assert.AreEqual(-2, items[0].SellIn);
        }
        public void itemQualityNeverExceedsMaxWhenIncrementingPerDay()
        {
            EditableItem agedBrie      = AgedBrie.Create(sellIn: 3, quality: MAX_QUANTITY);
            EditableItem backstagePass =
                ConcertBackstagePass.Create(concertName: "TaylorFast", sellIn: 3, quality: MAX_QUANTITY);

            items.Add(agedBrie);
            items.Add(backstagePass);

            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(MAX_QUANTITY, agedBrie.Quality);
            Assert.AreEqual(MAX_QUANTITY, backstagePass.Quality);
        }
        public void itemQualityNeverNegative()
        {
            EditableItem item1         = EditableItem.Create("Syomay", sellIn: 5, quality: 0);
            EditableItem backstagePass = ConcertBackstagePass.Create("TaylorFast", sellIn: 0, quality: 0);
            EditableItem conjured      = Conjured.Create("Conjured", sellIn: 0, quality: 2);

            items.Add(item1);
            items.Add(backstagePass);
            items.Add(conjured);

            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();

            Assert.AreEqual(0, item1.Quality);
            Assert.AreEqual(0, backstagePass.Quality);
            Assert.AreEqual(0, conjured.Quality);
        }
Beispiel #17
0
        public void itemQualityNeverNegative()
        {
            items.Add(new EditableItem {
                Name = "Syomay", SellIn = 5, Quality = 0
            });
            items.Add(new ConcertBackstagePass {
                Name = "TaylorFast", SellIn = 0, Quality = 0
            });
            items.Add(new Conjured {
                Name = "Conjured", SellIn = 0, Quality = 2
            });
            GildedRose app = new GildedRose(items);

            app.UpdateItemsQualityAfterADay();
            Assert.AreEqual(0, items[0].Quality);
            Assert.AreEqual(0, items[1].Quality);
            Assert.AreEqual(0, items[2].Quality);
        }