diff --git a/csharp/TheatricalPlayersRefactoringKata.Tests/StatementPrinterTests.cs b/csharp/TheatricalPlayersRefactoringKata.Tests/StatementPrinterTests.cs index 1a2bf15..9b10a64 100644 --- a/csharp/TheatricalPlayersRefactoringKata.Tests/StatementPrinterTests.cs +++ b/csharp/TheatricalPlayersRefactoringKata.Tests/StatementPrinterTests.cs @@ -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(); 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{new Performance("hamlet", 55), + var invoice = new Invoice("BigCo", new List{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(); 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{new Performance("hamlet", 55), + var invoice = new Invoice("BigCo", new List{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(); 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{new Performance("henry-v", 53), + var invoice = new Invoice("BigCoII", new List{new Performance("henry-v", 53), new Performance("as-like", 55)}); - StatementPrinter statementPrinter = new StatementPrinter(); + var statementPrinter = new StatementPrinter(); Assert.Throws(() => statementPrinter.Print(invoice, plays)); } diff --git a/csharp/TheatricalPlayersRefactoringKata.Tests/TheatricalPlayersRefactoringKata.Tests.csproj b/csharp/TheatricalPlayersRefactoringKata.Tests/TheatricalPlayersRefactoringKata.Tests.csproj index 916cf3a..63b09b2 100644 --- a/csharp/TheatricalPlayersRefactoringKata.Tests/TheatricalPlayersRefactoringKata.Tests.csproj +++ b/csharp/TheatricalPlayersRefactoringKata.Tests/TheatricalPlayersRefactoringKata.Tests.csproj @@ -1,19 +1,20 @@ - net5.0 + net6.0 false + 10 - - - - + + + + - - - + + + diff --git a/csharp/TheatricalPlayersRefactoringKata/StatementPrinter.cs b/csharp/TheatricalPlayersRefactoringKata/StatementPrinter.cs index 5dc980f..16e3d0b 100644 --- a/csharp/TheatricalPlayersRefactoringKata/StatementPrinter.cs +++ b/csharp/TheatricalPlayersRefactoringKata/StatementPrinter.cs @@ -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; } } diff --git a/csharp/TheatricalPlayersRefactoringKata/TheatricalPlayersRefactoringKata.csproj b/csharp/TheatricalPlayersRefactoringKata/TheatricalPlayersRefactoringKata.csproj index 1601b0f..92ba13d 100644 --- a/csharp/TheatricalPlayersRefactoringKata/TheatricalPlayersRefactoringKata.csproj +++ b/csharp/TheatricalPlayersRefactoringKata/TheatricalPlayersRefactoringKata.csproj @@ -1,8 +1,9 @@ - net5.0 + net6.0 false + 10