diff --git a/src/Chapter02.Tests/Listing02.09.Tests.cs b/src/Chapter02.Tests/Listing02.09.Tests.cs index c1aa5993..5f35f393 100644 --- a/src/Chapter02.Tests/Listing02.09.Tests.cs +++ b/src/Chapter02.Tests/Listing02.09.Tests.cs @@ -1,3 +1,5 @@ +using System.Globalization; + namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter02.Listing02_09.Tests; [TestClass] @@ -6,12 +8,14 @@ public class ProgramTests [TestMethod] public void Main_WriteBooleanStatements() { - string currentCultureString = 86540910.21.ToString("C"); + var number = 86540910.21; + string currentCultureString = number.ToString("C"); + string greekCultureString = number.ToString("C", CultureInfo.GetCultureInfo("el-GR")); string expected = $@"86540910.21 {currentCultureString} True: {currentCultureString} == {currentCultureString} -86.540.910,21 €"; +{greekCultureString}"; IntelliTect.TestTools.Console.ConsoleAssert.Expect( expected, Program.Main); diff --git a/src/Chapter02/Listing02.09.UsingStringFormat.cs b/src/Chapter02/Listing02.09.UsingStringFormat.cs index 8733a019..fa18afa2 100644 --- a/src/Chapter02/Listing02.09.UsingStringFormat.cs +++ b/src/Chapter02/Listing02.09.UsingStringFormat.cs @@ -1,5 +1,6 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter02.Listing02_09; +using System; using System.Globalization; public class Program