mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
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.
28 lines
585 B
C#
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);
|
|
}
|
|
}
|
|
|
|
} |