Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            IList <Item> Items = new List <Item> {
                StandardItemFactory.CreateItem("+5 Dexterity Vest", 10, 20),
                AgedBrieItemFactory.CreateItem(2, 0),
                StandardItemFactory.CreateItem("Elixir of the Mongoose", 5, 7),
                SulfurasItemFactory.CreateItem(0),
                SulfurasItemFactory.CreateItem(-1),
                BackstagePassItemFactory.CreateItem(15, 20),
                BackstagePassItemFactory.CreateItem(10, 49),
                BackstagePassItemFactory.CreateItem(5, 49),
                ConjuredItemFactory.CreateItem(3, 6)
            };

            for (var i = 0; i < 31; i++)
            {
                WriteLine("-------- day " + i + " --------");
                WriteLine("name, sellIn, quality");
                for (var j = 0; j < Items.Count; j++)
                {
                    WriteLine(Items[j]);
                    new GildedRose().UpdateQualityAndSellIn(Items[j]);
                }
                WriteLine("");
            }
        }
Exemplo n.º 2
0
        public void foo()
        {
            Item item = StandardItemFactory.CreateItem("foo", 0, 0);

            new GildedRose().UpdateQualityAndSellIn(item);
            item.Name.Should().BeEquivalentTo("foo");
            item.Quality.Should().Be(0);
            item.SellIn.Should().Be(-1);
        }