mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
63 lines
2.0 KiB
C#
63 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace csharp
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
Console.WriteLine("OMGHAI!");
|
|
IList<Item> items = CreateItems();
|
|
|
|
var gildedRose = new GildedRose(items);
|
|
|
|
for (var i = 0; i < 31; i++)
|
|
{
|
|
Console.WriteLine("-------- day " + i + " --------");
|
|
Console.WriteLine("name, sellIn, quality");
|
|
|
|
foreach (var item in items)
|
|
{
|
|
Console.WriteLine(item);
|
|
}
|
|
|
|
Console.WriteLine("");
|
|
gildedRose.UpdateQuality();
|
|
}
|
|
}
|
|
|
|
private static IList<Item> CreateItems()
|
|
{
|
|
IList<Item> 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 = "Sulfuras, Hand of Ragnaros", SellIn = -1, Quality = 80},
|
|
new Item
|
|
{
|
|
Name = "Backstage passes to a TAFKAL80ETC concert",
|
|
SellIn = 15,
|
|
Quality = 20
|
|
},
|
|
new Item
|
|
{
|
|
Name = "Backstage passes to a TAFKAL80ETC concert",
|
|
SellIn = 10,
|
|
Quality = 49
|
|
},
|
|
new Item
|
|
{
|
|
Name = "Backstage passes to a TAFKAL80ETC concert",
|
|
SellIn = 5,
|
|
Quality = 49
|
|
},
|
|
// this conjured item does not work properly yet
|
|
new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
|
|
};
|
|
return items;
|
|
}
|
|
}
|
|
}
|