public void CanGetItemCategoryFromItemName(string name, Category expectedcategory)
        {
            var item = new Item {
                Name = name
            };
            var category = ItemAlter.GetCategory(item);

            category.Should().Be(expectedcategory);
        }
        public void ConjuredItemAlterForConjuredItems()
        {
            var item = new Item {
                Name = "Conjured"
            };
            var alter = ItemAlter.GetInstanceFor(item);

            alter.Should().NotBeNull();
            alter.Should().BeOfType <ConjuredItemAlter>();
        }
        public void LegendaryItemAlterForLegendaryItems()
        {
            var item = new Item {
                Name = "Sulfuras"
            };
            var alter = ItemAlter.GetInstanceFor(item);

            alter.Should().NotBeNull();
            alter.Should().BeOfType <LegendaryItemAlter>();
        }
        public void CreatesAgedBrieProcessorForAgedBrie()
        {
            var item = new Item {
                Name = "Aged Brie"
            };
            var alter = ItemAlter.GetInstanceFor(item);

            alter.Should().NotBeNull();
            alter.Should().BeOfType <AgedBrieAlter>();
        }
        public void NormalItemAlterForNormalItems()
        {
            var item = new Item {
                Name = "Elixir"
            };
            var alter = ItemAlter.GetInstanceFor(item);

            alter.Should().NotBeNull();
            alter.Should().BeOfType <NormalItemAlter>();
        }
        public void CreatesBackstagePassAlterForBackstagePasses()
        {
            var item = new Item {
                Name = "Backstage passes"
            };

            var alter = ItemAlter.GetInstanceFor(item);

            alter.Should().NotBeNull();
            alter.Should().BeOfType <BackstagePassAlter>();
        }
        public void ShouldProcessSellinAndQualityAsPrescribed(string name, int sellin, int quality, int newsellin, int newquality)
        {
            var item = new Item {
                Name = name, Quality = quality, SellIn = sellin
            };

            ItemAlter.GetInstanceFor(item).UpdateItemQuality(item);
            item.Name.Should().Be(name);
            item.Quality.Should().Be(newquality);
            item.SellIn.Should().Be(newsellin);
        }
예제 #8
0
        private static void UpdateItemQuality(Item item)
        {
            var alter = ItemAlter.GetInstanceFor(item);

            alter.UpdateItemQuality(item);
        }