UpdateQuality() public method

public UpdateQuality ( ) : void
return void
Esempio n. 1
0
 protected static void PassNDays(Program program, int n)
 {
     for (var i = 0; i < n; i++)
     {
         program.UpdateQuality();
     }
 }
        static void Main(string[] args)
        {
            System.Console.WriteLine("OMGHAI!");

            var app = new Program()
            {
                Items = new List<Item>
                                          {
                                              new Item {Name = "+5 Dexterity Vest", SellIn = 10, Quality = 20},
                                              new Item {Name = "Aged Brie", SellIn = 2, Quality = 0},
                                              new Item {Name = "Elixir of the Mongoose", SellIn = 5, Quality = 7},
                                              new Item {Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80},
                                              new Item
                                                  {
                                                      Name = "Backstage passes to a TAFKAL80ETC concert",
                                                      SellIn = 15,
                                                      Quality = 20
                                                  },
                                              new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
                                          }

            };

            app.UpdateQuality();

            System.Console.ReadKey();
        }
Esempio n. 3
0
        public static void BuildConsoleOutput()
        {
            AppendToOutputString("OMGHAI!");

            var app = new Program()
            {
                _items = ItemList.Get()
            };

            for (var i = 0; i < 31; i++)
            {
                AppendToOutputString("-------- day " + i + " --------");
                AppendToOutputString("name, sellIn, quality");
                for (var j = 0; j < app._items.Count; j++)
                {
                    AppendToOutputString(
                        app._items[j].Name + ", " + app._items[j].SellIn + ", " + app._items[j].Quality);
                }

                AppendToOutputString("");
                app.UpdateQuality();
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("OMGHAI!");

            var app = new Program()
            {
                Items = new List <Item>
                {
                    new Item {
                        Name = "+5 Dexterity Vest", SellIn = 10, Quality = 20
                    },
                    new Item {
                        Name = "Aged Brie", SellIn = 2, Quality = 0
                    },
                    new Item {
                        Name = "Elixir of the Mongoose", SellIn = 5, Quality = 7
                    },
                    new Item {
                        Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80
                    },
                    new Item
                    {
                        Name    = "Backstage passes to a TAFKAL80ETC concert",
                        SellIn  = 15,
                        Quality = 20
                    },
                    new Item {
                        Name = "Conjured Mana Cake", SellIn = 3, Quality = 6
                    }
                }
            };

            app.UpdateQuality();

            System.Console.Read();
        }