Add separate project for tests

This commit is contained in:
Will Verland committed 2021-07-22 08:52:23 +12:00
1 parent 3eec127eff
commit b556848479
5 files changed
+47 -25

No files matched your search

-26
View File
@@ -1,26 +0,0 @@
using Xunit;
using System;
using System.IO;
using System.Text;
using ApprovalTests;
using ApprovalTests.Reporters;
namespace GuildedRose
{
[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);
}
}
}
-17
View File
@@ -1,17 +0,0 @@
using Xunit;
using System.Collections.Generic;
namespace GuildedRose
{
public class GildedRoseTest
{
[Fact]
public void foo()
{
IList<Item> Items = new List<Item> { new Item { Name = "foo", SellIn = 0, Quality = 0 } };
GildedRose app = new GildedRose(Items);
app.UpdateQuality();
Assert.Equal("fixme", Items[0].Name);
}
}
}
@@ -6,10 +6,4 @@
<StartupObject>GuildedRose.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ApprovalTests" Version="5.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>
</Project>