Esempio n. 1
0
        public void when_quality_will_be_greater_than_50_return_gildedrose_exception()
        {
            var product = new Product {
                Name = "Aged Brie", Sellin = -1, Quality = 50
            };
            var gildedRose = new GildedRose();

            Func <Task> action = async() => await gildedRose.UpdateProduct(product);;

            action.Should().ThrowExactly <GildedRoseException>().Which.MessageError.Should().Be("The quality never can be greater than 50");
        }
Esempio n. 2
0
        public void when_quality_will_be_negative_return_gildedrose_exception()
        {
            var product = new Product {
                Sellin = -1, Quality = 0
            };
            var gildedRose = new GildedRose();

            Func <Task> action = async() => await gildedRose.UpdateProduct(product);;

            action.Should().ThrowExactly <GildedRoseException>().Which.MessageError.Should().Be("The quality never can be negative");
        }
Esempio n. 3
0
        public void when_quality_for_sulfuras_is_diferent_to_80_return_gildedrose_exception()
        {
            var product = new Product {
                Name = "Sulfuras", Sellin = -1, Quality = 50
            };
            var gildedRose = new GildedRose();

            Func <Task> action = async() => await gildedRose.UpdateProduct(product);;

            action.Should().ThrowExactly <GildedRoseException>().Which.MessageError.Should().Be("The quality Sulfuras always 80");
        }
Esempio n. 4
0
        public async Task quality_increase_in_two_when_sellin_less_10_days_or_less_when_product_name_is_backstage_passes()
        {
            var product = new Product {
                Name = "Backstage passes", Sellin = 11, Quality = 10
            };
            var gildedRose = new GildedRose();

            var actualProduct = await gildedRose.UpdateProduct(product);

            actualProduct.Sellin.Should().Be(10);
            actualProduct.Quality.Should().Be(12);
        }
Esempio n. 5
0
        public async Task quality_and_sellin_never_decrease_when_product_name_is_sulfuras()
        {
            var product = new Product {
                Name = "Sulfuras", Sellin = 10, Quality = 80
            };
            var gildedRose = new GildedRose();

            var actualProduct = await gildedRose.UpdateProduct(product);

            actualProduct.Sellin.Should().Be(10);
            actualProduct.Quality.Should().Be(80);
        }
Esempio n. 6
0
        public async Task quality_increase_when_product_name_is_aged_brie()
        {
            var product = new Product {
                Name = "Aged Brie", Sellin = 10, Quality = 10
            };
            var gildedRose = new GildedRose();

            var actualProduct = await gildedRose.UpdateProduct(product);

            actualProduct.Quality.Should().Be(11);
            actualProduct.Sellin.Should().Be(9);
        }
Esempio n. 7
0
        public async Task  quality_double_degrade_when_sellin_value_has_passed()
        {
            var product = new Product {
                Sellin = -1, Quality = 10
            };
            var gildedRose = new GildedRose();

            var actualProduct = await gildedRose.UpdateProduct(product);

            actualProduct.Quality.Should().Be(8);
            actualProduct.Sellin.Should().Be(-2);
        }
Esempio n. 8
0
        public async Task quality_for_sulfuras_never_change_of_80()
        {
            var product = new Product {
                Name = "Sulfuras", Sellin = 12, Quality = 80
            };
            var gildedRose = new GildedRose();

            var actualProduct = await gildedRose.UpdateProduct(product);

            actualProduct.Sellin.Should().Be(12);
            actualProduct.Quality.Should().Be(80);
        }
Esempio n. 9
0
        public async Task quality_decrease_in_two_when_product_name_is_conjured()
        {
            var product = new Product {
                Name = "Conjured", Sellin = 12, Quality = 10
            };
            var gildedRose = new GildedRose();

            var actualProduct = await gildedRose.UpdateProduct(product);

            actualProduct.Sellin.Should().Be(11);
            actualProduct.Quality.Should().Be(8);
        }
Esempio n. 10
0
        public async Task quality_will_be_zero_when_sellin_will_be_zero_days_when_product_name_is_backstage_passes()
        {
            var product = new Product {
                Name = "Backstage passes", Sellin = 1, Quality = 10
            };
            var gildedRose = new GildedRose();

            var actualProduct = await gildedRose.UpdateProduct(product);

            actualProduct.Sellin.Should().Be(0);
            actualProduct.Quality.Should().Be(0);
        }