public static Item updateQuality(this Item item) { IList <Item> items = new List <Item> { item }; GildedRose app = new GildedRose(items); app.UpdateItem(); return(item); }
public void AgedBrie_QualityIncreasesBeforeSellByDate() { IList <Item> Items = new List <Item> { new Item { Name = "Aged Brie", SellIn = 10, Quality = 10 } }; GildedRose app = new GildedRose(Items); app.UpdateItem(); Assert.AreEqual(11, Items[0].Quality); }
public void ExampleTest() { IList <Item> Items = new List <Item> { new Item { Name = "foo", SellIn = 0, Quality = 0 } }; GildedRose app = new GildedRose(Items); app.UpdateItem(); Assert.AreEqual("foo", Items[0].Name); }
public void Legendary_QualityStaysAt80() { IList <Item> Items = new List <Item> { new Item { Name = "Sulfuras, Hand of Ragnaros", SellIn = 10, Quality = 80 } }; GildedRose app = new GildedRose(Items); app.UpdateItem(); Assert.AreEqual(80, Items[0].Quality); }
public void Conjured_QualityDegradesFasterAfterSellDate() { IList <Item> Items = new List <Item> { new Item { Name = "Conjured foo", SellIn = 0, Quality = 10 } }; GildedRose app = new GildedRose(Items); app.UpdateItem(); Assert.AreEqual(6, Items[0].Quality); }
public void Generic_QualityDegrades() { IList <Item> Items = new List <Item> { new Item { Name = "foo", SellIn = 10, Quality = 10 } }; GildedRose app = new GildedRose(Items); app.UpdateItem(); Assert.AreEqual(9, Items[0].Quality); }
public void BackstageTickets_QualityZeroAfterSellByDate() { IList <Item> Items = new List <Item> { new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 0, Quality = 10 } }; GildedRose app = new GildedRose(Items); app.UpdateItem(); Assert.AreEqual(0, Items[0].Quality); }
public void BackstageTickets_QualityIncreasesByThreeBeforeSellByDate() { IList <Item> Items = new List <Item> { new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 2, Quality = 10 } }; GildedRose app = new GildedRose(Items); app.UpdateItem(); Assert.AreEqual(13, Items[0].Quality); }
public void foo() { IList <Item> Items = new List <Item> { new Item { Name = "foo", SellIn = 0, Quality = 0 } }; GildedRose app = new GildedRose(Items); app.UpdateItem(); //Assert.AreEqual("foo", Items[0].Name); Assert.That(Items[0].Name, Is.EqualTo("foo")); }
public static void Main(string[] args) { 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++) { Console.WriteLine("-------- day " + i + " --------"); 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); } Console.WriteLine(""); app.UpdateItem(); } //Console.ReadLine(); }
public void UpdateQuality() { Items.ForEach(i => GildedRose.UpdateItem(i)); }