GildedRose-Refactoring-Kata/GildedRose/csharp/TextTestFixture.cs
emilybache 0319c8a5f7 I changed the starting position for the C# version to match the other translations, especially the Java version. This means I've actually done a small amount of refactoring
already compared with the original form of the kata, and made it easier to get going with
writing tests. It also makes it easier to do text-based approval testing with this code.
2013-03-20 09:33:53 +01:00

59 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
namespace GildedRose
{
class Program
{
public static void Main(string[] args)
{
System.Console.WriteLine("OMGHAI!");
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}
};
var app = new GildedRose(Items);
for (var i = 0; i < 31; i++)
{
System.Console.WriteLine("-------- day " + i + " --------");
System.Console.WriteLine("name, sellIn, quality");
for (var j = 0; j < Items.Count; j++)
{
System.Console.WriteLine(Items[j].Name + ", " + Items[j].SellIn + ", " + Items[j].Quality);
}
System.Console.WriteLine("");
app.UpdateQuality();
}
}
}
}