8b07ca2691da — MiyamotoAkira 11 months ago
Not a test, but basic setup to get it running
2 files changed, 37 insertions(+), 3 deletions(-)

M src/GildedRose.Console/Program.cs
M tests/GildedRose.Tests/UnitTest1.cs
M src/GildedRose.Console/Program.cs +7 -2
@@ 2,9 2,9 @@ 
 
 namespace GildedRose.Console
 {
-    class Program
+    public class Program
     {
-        IList<Item> Items;
+        public IList<Item> Items;
         static void Main(string[] args)
         {
             System.Console.WriteLine("OMGHAI!");

          
@@ 119,6 119,11 @@ namespace GildedRose.Console
         public int SellIn { get; set; }
 
         public int Quality { get; set; }
+
+        public override string ToString()
+        {
+            return $"Name: {Name}, SellIn: {SellIn}, Quality: {Quality}";
+        }
     }
 
 }

          
M tests/GildedRose.Tests/UnitTest1.cs +30 -1
@@ 1,14 1,43 @@ 
 using System;
+using System.Collections.Generic;
 using Xunit;
+using GildedRose.Console;
+
 
 namespace GildedRose.Tests
 {
     public class UnitTest1
     {
+        public List<Item> baseItems = 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 = "Backstage passes to a TAFKAL80ETC concert",
+                                                      SellIn = 15,
+                                                      Quality = 20
+                                                  },
+                                              new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
+                                          };
+
+        public Program CreateProgram() {
+            return new Program()
+                          {
+                              Items = baseItems
+
+                          };
+        }
+        
         [Fact]
         public void Test1()
         {
-
+            var app = CreateProgram();
+            baseItems.ForEach(item => System.Console.WriteLine(item));
+            app.UpdateQuality();
+            baseItems.ForEach(item => System.Console.WriteLine(item));
         }
     }
 }