mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-11 20:02:09 +00:00
Merge pull request #402 from claresudbery/csharp-approval-fixes
Csharp approval fixes
This commit is contained in:
commit
5a4e92199b
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ obj
|
||||
vendor
|
||||
.idea
|
||||
*.iml
|
||||
csharpcore/GildedRoseTests/ApprovalTest.ThirtyDays.received.txt
|
||||
|
||||
29
csharpcore/GildedRoseTests/ApprovalTest.cs
Normal file
29
csharpcore/GildedRoseTests/ApprovalTest.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using ApprovalTests;
|
||||
using ApprovalTests.Reporters;
|
||||
using GildedRoseTests;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace csharp
|
||||
{
|
||||
[UseReporter(typeof(DiffReporter))]
|
||||
[TestFixture]
|
||||
public class ApprovalTest
|
||||
{
|
||||
[Test]
|
||||
public void ThirtyDays()
|
||||
{
|
||||
|
||||
StringBuilder fakeoutput = new StringBuilder();
|
||||
Console.SetOut(new StringWriter(fakeoutput));
|
||||
Console.SetIn(new StringReader("a\n"));
|
||||
|
||||
TexttestFixture.Main(new string[] { });
|
||||
var output = fakeoutput.ToString();
|
||||
|
||||
Approvals.Verify(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ApprovalTests" Version="5.8.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
||||
|
||||
@ -42,7 +42,7 @@ namespace GildedRoseTests
|
||||
|
||||
var app = new GildedRose(Items);
|
||||
|
||||
int days = 2;
|
||||
int days = 31;
|
||||
if (args.Length > 0)
|
||||
{
|
||||
days = int.Parse(args[0]) + 1;
|
||||
|
||||
@ -21,7 +21,7 @@ diff_program:meld
|
||||
#interpreter:ruby
|
||||
|
||||
# Settings for the C# version
|
||||
#executable:${TEXTTEST_HOME}/GildedRose.exe
|
||||
#executable:${TEXTTEST_HOME}/csharp/bin/Debug/csharp.exe
|
||||
|
||||
# Settings for the Perl version
|
||||
#executable:${TEXTTEST_HOME}/perl/texttest_fixture.pl
|
||||
|
||||
Loading…
Reference in New Issue
Block a user