mirror of
https://github.com/ysoftdevs/Theatrical-Players-Refactoring-Kata.git
synced 2026-01-11 22:30:27 +01:00
upgrade to net6, update dependencies, conventions
This commit is contained in:
@@ -11,18 +11,18 @@ namespace TheatricalPlayersRefactoringKata.Tests
|
||||
{
|
||||
[Test]
|
||||
[UseReporter(typeof(DiffReporter))]
|
||||
public void test_statement_plain_text_example()
|
||||
public void Test_statement_plain_text_example()
|
||||
{
|
||||
var plays = new Dictionary<string, Play>();
|
||||
plays.Add("hamlet", new Play("Hamlet", "tragedy"));
|
||||
plays.Add("as-like", new Play("As You Like It", "comedy"));
|
||||
plays.Add("othello", new Play("Othello", "tragedy"));
|
||||
|
||||
Invoice invoice = new Invoice("BigCo", new List<Performance>{new Performance("hamlet", 55),
|
||||
var invoice = new Invoice("BigCo", new List<Performance>{new Performance("hamlet", 55),
|
||||
new Performance("as-like", 35),
|
||||
new Performance("othello", 40)});
|
||||
|
||||
StatementPrinter statementPrinter = new StatementPrinter();
|
||||
var statementPrinter = new StatementPrinter();
|
||||
var result = statementPrinter.Print(invoice, plays);
|
||||
|
||||
Approvals.Verify(result);
|
||||
@@ -30,18 +30,18 @@ namespace TheatricalPlayersRefactoringKata.Tests
|
||||
|
||||
[Test]
|
||||
[UseReporter(typeof(DiffReporter))]
|
||||
public void test_statement_html_example()
|
||||
public void Test_statement_html_example()
|
||||
{
|
||||
var plays = new Dictionary<string, Play>();
|
||||
plays.Add("hamlet", new Play("Hamlet", "tragedy"));
|
||||
plays.Add("as-like", new Play("As You Like It", "comedy"));
|
||||
plays.Add("othello", new Play("Othello", "tragedy"));
|
||||
|
||||
Invoice invoice = new Invoice("BigCo", new List<Performance>{new Performance("hamlet", 55),
|
||||
var invoice = new Invoice("BigCo", new List<Performance>{new Performance("hamlet", 55),
|
||||
new Performance("as-like", 35),
|
||||
new Performance("othello", 40)});
|
||||
|
||||
StatementPrinter statementPrinter = new StatementPrinter();
|
||||
var statementPrinter = new StatementPrinter();
|
||||
|
||||
// Not implemented yet
|
||||
// var result = statementPrinter.PrintAsHtml(invoice, plays);
|
||||
@@ -50,16 +50,16 @@ namespace TheatricalPlayersRefactoringKata.Tests
|
||||
|
||||
[Test]
|
||||
[UseReporter(typeof(DiffReporter))]
|
||||
public void test_statement_with_new_play_types()
|
||||
public void Test_statement_with_new_play_types()
|
||||
{
|
||||
var plays = new Dictionary<string, Play>();
|
||||
plays.Add("henry-v", new Play("Henry V", "history"));
|
||||
plays.Add("as-like", new Play("As You Like It", "pastoral"));
|
||||
|
||||
Invoice invoice = new Invoice("BigCoII", new List<Performance>{new Performance("henry-v", 53),
|
||||
var invoice = new Invoice("BigCoII", new List<Performance>{new Performance("henry-v", 53),
|
||||
new Performance("as-like", 55)});
|
||||
|
||||
StatementPrinter statementPrinter = new StatementPrinter();
|
||||
var statementPrinter = new StatementPrinter();
|
||||
|
||||
Assert.Throws<Exception>(() => statementPrinter.Print(invoice, plays));
|
||||
}
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>10</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ApprovalTests" Version="4.0.0" />
|
||||
<PackageReference Include="FakeItEasy" Version="6.2.1" />
|
||||
<PackageReference Include="FluentAssertions" Version="5.10.3" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
|
||||
<PackageReference Include="ApprovalTests" Version="5.7.2" />
|
||||
<PackageReference Include="FakeItEasy" Version="7.3.1" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.5.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="NBuilder" Version="6.1.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="NUnit" Version="3.13.1" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -41,11 +41,11 @@ namespace TheatricalPlayersRefactoringKata
|
||||
if ("comedy" == play.Type) volumeCredits += (int)Math.Floor((decimal)perf.Audience / 5);
|
||||
|
||||
// print line for this order
|
||||
result += String.Format(cultureInfo, " {0}: {1:C} ({2} seats)\n", play.Name, Convert.ToDecimal(thisAmount / 100), perf.Audience);
|
||||
result += string.Format(cultureInfo, " {0}: {1:C} ({2} seats)\n", play.Name, Convert.ToDecimal(thisAmount / 100), perf.Audience);
|
||||
totalAmount += thisAmount;
|
||||
}
|
||||
result += String.Format(cultureInfo, "Amount owed is {0:C}\n", Convert.ToDecimal(totalAmount / 100));
|
||||
result += String.Format("You earned {0} credits\n", volumeCredits);
|
||||
result += string.Format(cultureInfo, "Amount owed is {0:C}\n", Convert.ToDecimal(totalAmount / 100));
|
||||
result += string.Format("You earned {0} credits\n", volumeCredits);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>10</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user