public void ShouldNotAffectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance());

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.Should().Be(product);
        }
        public void GivenConjuredItem_WhenAdjustingConjuredProductQuality_ThenItShouldReturnCorrectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Conjured Mana Cake", 10, 10));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.ToString().Should().Be("Conjured Mana Cake, 10, 8");
        }
        public void GivenNonConjuredItem_WhenAdjustingConjuredProductQuality_ThenItShouldNotAffectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Copper Ingot", 10, 10));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.Should().Be(product);
        }
        public void GivenConjuredItemWithLifetimeAndQuality_WhenAdjustingCommonQuality_ThenItShouldNotAffectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Conjured Mana Cake", 5, 5));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.Should().Be(product);
        }
        public void GivenEventPassWithLifetimeAndQuality_WhenAdjustingCommonQuality_ThenItShouldNotAffectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Backstage passes to a TAFKAL80ETC concert", 10, 10));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.Should().Be(product);
        }
Ejemplo n.º 6
0
        public void GivenLegendaryItemWithLifetimeAndQuality_WhenAdjustingAgedItemQuality_ThenItShouldNotAffectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Sulfuras, Hand of Ragnaros", -1, 40));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.Should().Be(product);
        }
        public void GivenCommonItemWithLifetimeAndZeroQuality_WhenAdjustingCommonQuality_ThenItShouldReturnCorrectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Torch", 5, 0));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.ToString().Should().Be("Torch, 5, 0");
        }
Ejemplo n.º 8
0
        public void GivenCommonItemWithLifetimeAndQuality_WhenAdjustingAgedItemQuality_ThenItShouldNotAffectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Large Sack", 10, 10));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.Should().Be(product);
        }
Ejemplo n.º 9
0
        public void GivenAgedItemWithLifetimeAndQuality_WhenAdjustingAgedItemQuality_ThenItShouldReturnCorrectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Aged Brie", 10, 10));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.ToString().Should().Be("Aged Brie, 10, 11");
        }
        public void GivenEventPassWithLifetimeFiveDaysAndFortyNineQuality_WhenAdjustingEventPassQuality_ThenItShouldReturnCorrectProduct()
        {
            // arrange
            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance("Backstage passes to a TAFKAL80ETC concert", 5, 49));

            // act
            IProduct actual = product.WithAdjustedQuality();

            // assert
            actual.ToString().Should().Be("Backstage passes to a TAFKAL80ETC concert, 5, 50");
        }
Ejemplo n.º 11
0
        public void GivenEventPassAtMaximumQuality_WhenAskingEventPassQualityAddend_ShouldReturnZero()
        {
            // arrange
            const string largeSack = "Concert Ticket";
            const int    sellIn    = 10;
            const int    quality   = 50;

            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance(largeSack, sellIn, quality));

            // act
            int actual = product.EventPassQualityAddend();

            // assert
            actual.Should().Be(0);
        }
Ejemplo n.º 12
0
        public void GivenEventPasExpired_WhenAskingEventPassQualityAddend_ShouldReturnInverseOfQuality()
        {
            // arrange
            const string largeSack = "Concert Ticket";
            const int    sellIn    = -1;
            const int    quality   = 10;

            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance(largeSack, sellIn, quality));

            // act
            int actual = product.EventPassQualityAddend();

            // assert
            actual.Should().Be(-10);
        }
Ejemplo n.º 13
0
        public void GivenEventPassLifetimeFour_WhenAskingEventPassQualityAddend_ShouldReturnThree()
        {
            // arrange
            const string largeSack = "Concert Ticket";
            const int    sellIn    = 4;
            const int    quality   = 10;

            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance(largeSack, sellIn, quality));

            // act
            int actual = product.EventPassQualityAddend();

            // assert
            actual.Should().Be(3);
        }
Ejemplo n.º 14
0
        public void GivenProduct_WhenAskingForReport_ShouldOutputCorrectInformation()
        {
            // arrange
            const string largeSack = "Large Sack";
            const int    sellIn    = 10;
            const int    quality   = 10;

            IProduct product = new Product(_qualityAdjustment, FakeItem.Instance(largeSack, sellIn, quality));

            // act
            string actual = product.ToString();

            // assert
            actual.Should().Be($"{largeSack}, {sellIn}, {quality}");
        }