public void Setup()
 {
     _qualityCalculator = new QualityCalculator(_standardItems);
     for (int i = 0; i < 51; i++)
     {
         _qualityCalculator.UpdateQuality();
     }
 }
        public void ThenQuality_ShouldBe_0()
        {
            IList<Item> items = TestResources.GetBackStagePassesHavingSellinOf(0);
            QualityCalculator qualityCalculator = new QualityCalculator(items);

            qualityCalculator.UpdateQuality();
            int actualQuality = GildedTestHelper.GetQualityOfItem(items, GildedRoseResourceStrings.BackstagePassesToATafkal80EtcConcert);

            Assert.That(actualQuality, Is.EqualTo(0));
        }
        public void Then_Quality_ShouldBeDecrementedBy2()
        {
            IList<Item> items = TestResources.GetConjuredItems();
            int originalQuality = GetQualityOfConjuredItem(items);
            QualityCalculator qualityCalculator = new QualityCalculator(items);
            qualityCalculator.UpdateQuality();

            int updatedQuality = GetQualityOfConjuredItem(items);
            int qualityDifference = originalQuality - updatedQuality;

            Assert.That(qualityDifference, Is.EqualTo(2));
        }
        public void ThenTheQuality_IsReducedBy_2(string itemName)
        {
            IList<Item> standardItems = TestResources.GetStandardItemsHavingSellInOf0();
            QualityCalculator qualityCalculator = new QualityCalculator(standardItems);
            int qualityWhenSellInReached0 = GildedTestHelper.GetQualityOfItem(standardItems, itemName);

            qualityCalculator.UpdateQuality();
            int newQuality = GildedTestHelper.GetQualityOfItem(standardItems, itemName);
            int qualityDifference =  qualityWhenSellInReached0 - newQuality;

            Assert.That(qualityDifference, Is.EqualTo(2));
        }
        public void Then_QualityIncreasesBy3_EachDay(int initialSellingValue)
        {
            IList<Item> items = TestResources.GetBackStagePassesHavingSellinOf(initialSellingValue);
            int originalQuality = GildedTestHelper.GetQualityOfItem(items, GildedRoseResourceStrings.BackstagePassesToATafkal80EtcConcert);
            QualityCalculator qualityCalculator = new QualityCalculator(items);

            qualityCalculator.UpdateQuality();
            int updatedQuality = GildedTestHelper.GetQualityOfItem(items, GildedRoseResourceStrings.BackstagePassesToATafkal80EtcConcert);
            int qualityDifference = updatedQuality - originalQuality;

            Assert.That(qualityDifference, Is.EqualTo(3));
        }