mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-06-15 05:10:58 +00:00
57 lines
1.8 KiB
C#
57 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace csharp
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
Console.WriteLine("Calculating the inventory report...");
|
|
|
|
IList<Item> Items = new List<Item>{
|
|
new Item {Name = "Sports Memorabilia", SellIn = 10, Quality = 20},
|
|
new Item {Name = "Aged Cheese", SellIn = 2, Quality = 0},
|
|
new Item {Name = "Coffee Table Book", SellIn = 5, Quality = 7},
|
|
new Item {Name = "Fine Italian Silk", SellIn = 0, Quality = 80},
|
|
new Item {Name = "Fine Italian Silk", SellIn = -1, Quality = 80},
|
|
new Item
|
|
{
|
|
Name = "Backstage passes to a concert",
|
|
SellIn = 15,
|
|
Quality = 20
|
|
},
|
|
new Item
|
|
{
|
|
Name = "Backstage passes to a concert",
|
|
SellIn = 10,
|
|
Quality = 49
|
|
},
|
|
new Item
|
|
{
|
|
Name = "Backstage passes to a concert",
|
|
SellIn = 5,
|
|
Quality = 49
|
|
},
|
|
// this Baked item does not work properly yet
|
|
new Item {Name = "Baked Chocolate Cake", SellIn = 3, Quality = 6}
|
|
};
|
|
|
|
var app = new GildedRose(Items);
|
|
|
|
|
|
for (var i = 0; i < 31; i++)
|
|
{
|
|
Console.WriteLine("-------- day " + i + " --------");
|
|
Console.WriteLine("name, sellIn, quality");
|
|
for (var j = 0; j < Items.Count; j++)
|
|
{
|
|
System.Console.WriteLine(Items[j]);
|
|
}
|
|
Console.WriteLine("");
|
|
app.UpdateQuality();
|
|
}
|
|
}
|
|
}
|
|
}
|