mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-11 20:02:09 +00:00
Remove ApprovalTest and add TexttestFixture
This commit is contained in:
parent
71fb9d59b1
commit
4746d897f5
@ -1,9 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<StartupObject>GildedRoseKata.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
using Xunit;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using ApprovalTests;
|
||||
using ApprovalTests.Reporters;
|
||||
using GildedRoseKata;
|
||||
|
||||
namespace GildedRoseTests
|
||||
{
|
||||
[UseReporter(typeof(DiffReporter))]
|
||||
public class ApprovalTest
|
||||
{
|
||||
[Fact]
|
||||
public void ThirtyDays()
|
||||
{
|
||||
var fakeoutput = new StringBuilder();
|
||||
Console.SetOut(new StringWriter(fakeoutput));
|
||||
Console.SetIn(new StringReader("a\n"));
|
||||
|
||||
Program.Main(new string[] { });
|
||||
var output = fakeoutput.ToString();
|
||||
|
||||
Approvals.Verify(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,20 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<StartupObject>GildedRoseTests.TexttestFixture</StartupObject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ApprovalTests" Version="5.7.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GildedRose\GildedRose.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GildedRose\GildedRose.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
using System;
|
||||
|
||||
using GildedRoseKata;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GildedRoseKata
|
||||
namespace GildedRoseTests
|
||||
{
|
||||
public class Program
|
||||
public static class TexttestFixture
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
@ -33,14 +36,19 @@ namespace GildedRoseKata
|
||||
SellIn = 5,
|
||||
Quality = 49
|
||||
},
|
||||
// this conjured item does not work properly yet
|
||||
new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
|
||||
// this conjured item does not work properly yet
|
||||
new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
|
||||
};
|
||||
|
||||
var app = new GildedRose(Items);
|
||||
|
||||
int days = 2;
|
||||
if (args.Length > 0)
|
||||
{
|
||||
days = int.Parse(args[0]) + 1;
|
||||
}
|
||||
|
||||
for (var i = 0; i < 31; i++)
|
||||
for (var i = 0; i < days; i++)
|
||||
{
|
||||
Console.WriteLine("-------- day " + i + " --------");
|
||||
Console.WriteLine("name, sellIn, quality");
|
||||
Loading…
Reference in New Issue
Block a user