update base project

This commit is contained in:
OKinane 2023-03-11 16:08:03 +01:00
parent f322e6eb1b
commit c1b5cf8001
9 changed files with 77 additions and 51 deletions

View File

@ -1,26 +0,0 @@
using Xunit;
using System;
using System.IO;
using System.Text;
using ApprovalTests;
using ApprovalTests.Reporters;
namespace csharpcore
{
[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);
}
}
}

31
csharpcore/GildedRose.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31424.327
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GildedRose", "GildedRose\GildedRose.csproj", "{D781C52B-92C0-48BF-8414-177495DF4174}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GildedRoseTests", "GildedRoseTests\GildedRoseTests.csproj", "{CB6715CE-A283-4C70-9C1B-F58822077731}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D781C52B-92C0-48BF-8414-177495DF4174}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D781C52B-92C0-48BF-8414-177495DF4174}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D781C52B-92C0-48BF-8414-177495DF4174}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D781C52B-92C0-48BF-8414-177495DF4174}.Release|Any CPU.Build.0 = Release|Any CPU
{CB6715CE-A283-4C70-9C1B-F58822077731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB6715CE-A283-4C70-9C1B-F58822077731}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB6715CE-A283-4C70-9C1B-F58822077731}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB6715CE-A283-4C70-9C1B-F58822077731}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {02785EA4-86A5-4E57-9A9A-6998FAE1E617}
EndGlobalSection
EndGlobal

View File

@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace csharpcore
namespace GildedRoseKata
{
public class GildedRose
{

View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -1,4 +1,4 @@
namespace csharpcore
namespace GildedRoseKata
{
public class Item
{

View File

@ -1,7 +1,8 @@
using Xunit;
using System.Collections.Generic;
using GildedRoseKata;
namespace csharpcore
namespace GildedRoseTests
{
public class GildedRoseTest
{
@ -14,4 +15,4 @@ namespace csharpcore
Assert.Equal("fixme", Items[0].Name);
}
}
}
}

View File

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<StartupObject>GildedRoseTests.TexttestFixture</StartupObject>
</PropertyGroup>
<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>
</Project>

View File

@ -1,9 +1,12 @@
using System;

using GildedRoseKata;
using System;
using System.Collections.Generic;
namespace csharpcore
namespace GildedRoseTests
{
public class Program
public static class TexttestFixture
{
public static void Main(string[] args)
{
@ -33,14 +36,19 @@ namespace csharpcore
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");

View File

@ -1,15 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<StartupObject>csharpcore.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ApprovalTests" Version="4.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
</ItemGroup>
</Project>