diff --git a/csharpcore/GildedRose/GildedRose.csproj b/csharpcore/GildedRose/GildedRose.csproj index 405ad28f..fff78129 100644 --- a/csharpcore/GildedRose/GildedRose.csproj +++ b/csharpcore/GildedRose/GildedRose.csproj @@ -1,9 +1,7 @@  - Exe net6.0 - GildedRoseKata.Program diff --git a/csharpcore/GildedRoseTests/ApprovalTest.cs b/csharpcore/GildedRoseTests/ApprovalTest.cs deleted file mode 100644 index 178e66a7..00000000 --- a/csharpcore/GildedRoseTests/ApprovalTest.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Xunit; -using System; -using System.IO; -using System.Text; -using ApprovalTests; -using ApprovalTests.Reporters; -using GildedRoseKata; - -namespace GildedRoseTests -{ - [UseReporter(typeof(DiffReporter))] - public class ApprovalTest - { - [Fact] - public void ThirtyDays() - { - var fakeoutput = new StringBuilder(); - Console.SetOut(new StringWriter(fakeoutput)); - Console.SetIn(new StringReader("a\n")); - - Program.Main(new string[] { }); - var output = fakeoutput.ToString(); - - Approvals.Verify(output); - } - } -} diff --git a/csharpcore/GildedRoseTests/GildedRoseTests.csproj b/csharpcore/GildedRoseTests/GildedRoseTests.csproj index 88ec0900..93a44263 100644 --- a/csharpcore/GildedRoseTests/GildedRoseTests.csproj +++ b/csharpcore/GildedRoseTests/GildedRoseTests.csproj @@ -1,20 +1,20 @@  - - net6.0 - false - + + Exe + net6.0 + GildedRoseTests.TexttestFixture + - - - - - - - + + + + + + - - - + + + diff --git a/csharpcore/GildedRose/Program.cs b/csharpcore/GildedRoseTests/TexttestFixture.cs similarity index 80% rename from csharpcore/GildedRose/Program.cs rename to csharpcore/GildedRoseTests/TexttestFixture.cs index 1367fe73..cccaf5f9 100644 --- a/csharpcore/GildedRose/Program.cs +++ b/csharpcore/GildedRoseTests/TexttestFixture.cs @@ -1,9 +1,12 @@ -using System; + +using GildedRoseKata; + +using System; using System.Collections.Generic; -namespace GildedRoseKata +namespace GildedRoseTests { - public class Program + public static class TexttestFixture { public static void Main(string[] args) { @@ -33,14 +36,19 @@ namespace GildedRoseKata SellIn = 5, Quality = 49 }, - // this conjured item does not work properly yet - new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6} + // this conjured item does not work properly yet + new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6} }; var app = new GildedRose(Items); + int days = 2; + if (args.Length > 0) + { + days = int.Parse(args[0]) + 1; + } - for (var i = 0; i < 31; i++) + for (var i = 0; i < days; i++) { Console.WriteLine("-------- day " + i + " --------"); Console.WriteLine("name, sellIn, quality");