mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
30 lines
744 B
C#
30 lines
744 B
C#
using Xunit;
|
|
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
|
|
namespace csharpcore
|
|
{
|
|
public class ApprovalTest
|
|
{
|
|
[Fact]
|
|
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.Equal(lines[i], outputLines[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|