From 26ce76c750fe158715b1ac127f256d33b3e373d9 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Sun, 2 Jun 2024 11:19:44 +0200 Subject: [PATCH] Empyt line + IList Items; --- csharp.NUnit/GildedRose/Program.cs | 1 - csharp.xUnit/GildedRose/GildedRose.cs | 56 +++++++++++++-------------- csharp.xUnit/GildedRose/Program.cs | 1 - 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/csharp.NUnit/GildedRose/Program.cs b/csharp.NUnit/GildedRose/Program.cs index b9ad54cb..1c71999e 100644 --- a/csharp.NUnit/GildedRose/Program.cs +++ b/csharp.NUnit/GildedRose/Program.cs @@ -34,7 +34,6 @@ public class Program SellIn = 5, Quality = 49 }, - // this conjured item does not work properly yet new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6} }; diff --git a/csharp.xUnit/GildedRose/GildedRose.cs b/csharp.xUnit/GildedRose/GildedRose.cs index 7ec604b6..c08bf5f8 100644 --- a/csharp.xUnit/GildedRose/GildedRose.cs +++ b/csharp.xUnit/GildedRose/GildedRose.cs @@ -4,83 +4,83 @@ namespace GildedRoseKata; public class GildedRose { - private readonly IList _items; + IList Items; - public GildedRose(IList items) + public GildedRose(IList Items) { - _items = items; + this.Items = Items; } public void UpdateQuality() { - for (var i = 0; i < _items.Count; i++) + for (var i = 0; i < Items.Count; i++) { - if (_items[i].Name != "Aged Brie" && _items[i].Name != "Backstage passes to a TAFKAL80ETC concert") + if (Items[i].Name != "Aged Brie" && Items[i].Name != "Backstage passes to a TAFKAL80ETC concert") { - if (_items[i].Quality > 0) + if (Items[i].Quality > 0) { - if (_items[i].Name != "Sulfuras, Hand of Ragnaros") + if (Items[i].Name != "Sulfuras, Hand of Ragnaros") { - _items[i].Quality = _items[i].Quality - 1; + Items[i].Quality = Items[i].Quality - 1; } } } else { - if (_items[i].Quality < 50) + if (Items[i].Quality < 50) { - _items[i].Quality = _items[i].Quality + 1; + Items[i].Quality = Items[i].Quality + 1; - if (_items[i].Name == "Backstage passes to a TAFKAL80ETC concert") + if (Items[i].Name == "Backstage passes to a TAFKAL80ETC concert") { - if (_items[i].SellIn < 11) + if (Items[i].SellIn < 11) { - if (_items[i].Quality < 50) + if (Items[i].Quality < 50) { - _items[i].Quality = _items[i].Quality + 1; + Items[i].Quality = Items[i].Quality + 1; } } - if (_items[i].SellIn < 6) + if (Items[i].SellIn < 6) { - if (_items[i].Quality < 50) + if (Items[i].Quality < 50) { - _items[i].Quality = _items[i].Quality + 1; + Items[i].Quality = Items[i].Quality + 1; } } } } } - if (_items[i].Name != "Sulfuras, Hand of Ragnaros") + if (Items[i].Name != "Sulfuras, Hand of Ragnaros") { - _items[i].SellIn = _items[i].SellIn - 1; + Items[i].SellIn = Items[i].SellIn - 1; } - if (_items[i].SellIn < 0) + if (Items[i].SellIn < 0) { - if (_items[i].Name != "Aged Brie") + if (Items[i].Name != "Aged Brie") { - if (_items[i].Name != "Backstage passes to a TAFKAL80ETC concert") + if (Items[i].Name != "Backstage passes to a TAFKAL80ETC concert") { - if (_items[i].Quality > 0) + if (Items[i].Quality > 0) { - if (_items[i].Name != "Sulfuras, Hand of Ragnaros") + if (Items[i].Name != "Sulfuras, Hand of Ragnaros") { - _items[i].Quality = _items[i].Quality - 1; + Items[i].Quality = Items[i].Quality - 1; } } } else { - _items[i].Quality = _items[i].Quality - _items[i].Quality; + Items[i].Quality = Items[i].Quality - Items[i].Quality; } } else { - if (_items[i].Quality < 50) + if (Items[i].Quality < 50) { - _items[i].Quality = _items[i].Quality + 1; + Items[i].Quality = Items[i].Quality + 1; } } } diff --git a/csharp.xUnit/GildedRose/Program.cs b/csharp.xUnit/GildedRose/Program.cs index 97327e26..1ee22960 100644 --- a/csharp.xUnit/GildedRose/Program.cs +++ b/csharp.xUnit/GildedRose/Program.cs @@ -34,7 +34,6 @@ public class Program SellIn = 5, Quality = 49 }, - // this conjured item does not work properly yet new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6} };