mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
modification
- Modified files
This commit is contained in:
parent
a15e48a03e
commit
5e30e45736
@ -9,5 +9,10 @@ namespace GildedRoseKata
|
||||
{
|
||||
this.Items = Items;
|
||||
}
|
||||
|
||||
public static object GetPropValue(object src, string propName)
|
||||
{
|
||||
return src.GetType().GetProperty(propName).GetValue(src, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,9 +41,9 @@ namespace GildedRoseKata
|
||||
// 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 + " --------");
|
||||
@ -55,7 +55,7 @@ namespace GildedRoseKata
|
||||
|
||||
// Get the type contained
|
||||
Type type = t.GetType();
|
||||
var instance = Activator.CreateInstance(type);
|
||||
dynamic instance = Activator.CreateInstance(type) as Item;
|
||||
|
||||
// Get a property on the type that is stored in the
|
||||
// property string
|
||||
@ -78,6 +78,10 @@ namespace GildedRoseKata
|
||||
updateQualityMethod.Invoke(instance, new object[0]);
|
||||
updateSellinMethod.Invoke(instance, new object[0]);
|
||||
|
||||
// update t
|
||||
t.SellIn = instance.SellIn;
|
||||
t.Quality = instance.Quality;
|
||||
|
||||
Console.WriteLine("");
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user