mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 20:32:15 +00:00
31 lines
771 B
C#
31 lines
771 B
C#
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
using NUnit.Framework;
|
|
|
|
namespace csharp
|
|
{
|
|
[TestFixture]
|
|
public class ApprovalTest
|
|
{
|
|
[Test]
|
|
public void ThirtyDays()
|
|
{
|
|
var lines = File.ReadAllLines("ThirtyDays.txt");
|
|
|
|
StringBuilder fakeoutput = new StringBuilder();
|
|
Console.SetOut(new StringWriter(fakeoutput));
|
|
Console.SetIn(new StringReader("a\n"));
|
|
|
|
Program.Main(new string[] { });
|
|
String output = fakeoutput.ToString();
|
|
|
|
var outputLines = output.Split('\n');
|
|
for(var i = 0; i<Math.Min(lines.Length, outputLines.Length); i++)
|
|
{
|
|
Assert.AreEqual(lines[i], outputLines[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|