GildedRose-Refactoring-Kata/csharpcore/GildedRoseTests/ApprovalTest.cs
2023-11-28 08:46:04 +00:00

25 lines
572 B
C#

using System;
using System.IO;
using System.Text;
using ApprovalTests;
using ApprovalTests.Reporters;
using NUnit.Framework;
namespace GildedRoseTests;
[UseReporter(typeof(DiffReporter))]
public class ApprovalTest
{
[Test]
public void ThirtyDays()
{
var fakeOutput = new StringBuilder();
Console.SetOut(new StringWriter(fakeOutput));
Console.SetIn(new StringReader($"a{Environment.NewLine}"));
TextTestFixture.Main(new string[] { "30" });
var output = fakeOutput.ToString();
Approvals.Verify(output);
}
}