GildedRose-Refactoring-Kata/GildedRose/csharp/ApprovalTest.cs
emilybache 0319c8a5f7 I changed the starting position for the C# version to match the other translations, especially the Java version. This means I've actually done a small amount of refactoring
already compared with the original form of the kata, and made it easier to get going with
writing tests. It also makes it easier to do text-based approval testing with this code.
2013-03-20 09:33:53 +01:00

28 lines
585 B
C#

using System;
using System.IO;
using System.Text;
using GildedRose;
using NUnit.Framework;
using ApprovalTests;
using ApprovalTests.Reporters;
namespace GildedRoseTests
{
[TestFixture]
[UseReporter(typeof(NUnitReporter))]
public class ApprovalTest
{
[Test]
public void ThirtyDays()
{
StringBuilder fakeoutput = new StringBuilder();
Console.SetOut(new StringWriter(fakeoutput));
Console.SetIn(new StringReader("a\n"));
Program.Main(new string[] { });
String output = fakeoutput.ToString();
Approvals.Verify(output);
}
}
}