예제 #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("OMGHAI!");

            var items = new List<Item>
                                    {
                                        new Item { Name = ProductName.DexterityVest, SellIn = 10, Quality = 20 },
                                        new Item { Name = ProductName.AgedBrie, SellIn = 2, Quality = 0 },
                                        new Item { Name = ProductName.MongooseElixir, SellIn = 5, Quality = 7 },
                                        new Item { Name = ProductName.Sulfuras.HandOfRagnaros, SellIn = 0, Quality = 80 },
                                        new Item { Name = ProductName.Sulfuras.HandOfRagnaros, SellIn = -1, Quality = 80 },
                                        new Item { Name = ProductName.BackStagePasses.Tafkal80Etc, SellIn = 15, Quality = 20 },
                                        new Item { Name = ProductName.BackStagePasses.Tafkal80Etc, SellIn = 10, Quality = 49 },
                                        new Item { Name = ProductName.BackStagePasses.Tafkal80Etc, SellIn = 5, Quality = 49 },
                                        new Item { Name = ProductName.ConjuredManaCake, SellIn = 3, Quality = 6 }
                                    };

            var app = new GildedRose(items, new QualityHandler(), new SellInHandler());

            for (var i = 0; i < 31; i++)
            {
                Console.WriteLine("-------- day " + i + " --------");
                Console.WriteLine("name, sellIn, quality");

                items.ForEach(x => Console.WriteLine(FormatItem(x)));

                Console.WriteLine(string.Empty);

                app.ProcessItems();
            }

            Console.ReadKey();
        }
예제 #2
0
        public void foo()
        {
            var items = new List<Item> { new Item { Name = "foo", SellIn = 0, Quality = 0 } };
            var app = new GildedRose(items, new QualityHandler(), new SellInHandler());

            app.ProcessItems();

            Assert.AreEqual("fixme", items[0].Name);
        }