GildedRose-Refactoring-Kata/csharpcore/GildedRoseTests/ApprovalTest.cs
Sarah Ashri cb822ff94e Fixed ApprovalTest to work with local expectedOutput file
This is preparation for adding the conjured items
2024-03-15 14:11:24 +10:00

24 lines
691 B
C#

using System;
using System.IO;
using System.Text;
using FluentAssertions;
using NUnit.Framework;
namespace GildedRoseTests;
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();
var expectedOutput = File.ReadAllText(@"C:\MyFiles\Training\GildedRose-Refactoring-Kata\csharpcore\GildedRoseTests\ExpectedApprovalTestOutput_WithoutConjured.txt");
expectedOutput.Should().Be(output);
}
}