GildedRose-Refactoring-Kata/csharpcore/GildedRose/Program.cs
Adefolarin Adeniji e625aed95a Updates
- Updated CustomMethod
- Updated implementation of update quality and sellin in derived classes
2021-08-27 15:01:36 +01:00

62 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using GildedRose.Models;
namespace GildedRoseKata
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("OMGHAI!");
IList<Item> items = new List<Item>{
new Dexterity() {Name = "+5 Dexterity Vest", SellIn = 10, Quality = 20},
new AgedBrie() {Name = "Aged Brie", SellIn = 2, Quality = 0},
new Elixir() {Name = "Elixir of the Mongoose", SellIn = 5, Quality = 7},
new Sulfuras() {Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80},
new Sulfuras {Name = "Sulfuras, Hand of Ragnaros", SellIn = -1, Quality = 80},
new BackStagePasses()
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 15,
Quality = 20
},
new BackStagePasses
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 10,
Quality = 49
},
new BackStagePasses
{
Name = "Backstage passes to a TAFKAL80ETC concert",
SellIn = 5,
Quality = 49
},
// this conjured item does not work properly yet
new Conjured() {Name = "Conjured Mana 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");
foreach (Item t in items)
{
Console.WriteLine(t.Name + ", " + t.SellIn + ", " + t.Quality);
}
Console.WriteLine("");
app.UpdateQuality();
}
}
}
}