From fa540aac1afd099b27e5f052846636de79c93afa Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Tue, 29 Aug 2023 15:12:03 -0700 Subject: [PATCH 1/4] fix: corrupted unicode character --- src/Chapter09/Listing09.16.OverridingToString.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Chapter09/Listing09.16.OverridingToString.cs b/src/Chapter09/Listing09.16.OverridingToString.cs index ec26dc1d..704c850a 100644 --- a/src/Chapter09/Listing09.16.OverridingToString.cs +++ b/src/Chapter09/Listing09.16.OverridingToString.cs @@ -19,7 +19,7 @@ public override string ToString() { string prefix = string.IsNullOrWhiteSpace(Name) ? string.Empty : Name + ": "; - return $"{prefix}{Degrees}� {Minutes}' {Seconds}\""; + return $"{prefix}{Degrees}° {Minutes}' {Seconds}\""; } #endregion INCLUDE } From ee0cc999096e56a1633965efe898a8e91fef2836 Mon Sep 17 00:00:00 2001 From: Mark Michaelis Date: Fri, 1 Sep 2023 07:42:07 +0100 Subject: [PATCH 2/4] Updated test --- src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs b/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs index 5d697db0..57a489bb 100644 --- a/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs +++ b/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs @@ -12,8 +12,8 @@ public void Override_ToString_MatchesExpectedValue() Angle angle1 = new(120, 20, 20, "AngleName"); Angle angle2 = new(320, 10, 10, null); - string expected1 = $"AngleName: 120� 20' 20\""; - string expected2 = $"320� 10' 10\""; + string expected1 = $"AngleName: 120º 20' 20\""; + string expected2 = $"320º 10' 10\""; string actual1 = angle1.ToString(); string actual2 = angle2.ToString(); From 3b6b57fc9cb4bfd815ee03fc0e3801af01479b86 Mon Sep 17 00:00:00 2001 From: Mark Michaelis Date: Fri, 1 Sep 2023 14:57:12 +0100 Subject: [PATCH 3/4] Updated degree symbol --- src/Chapter06/Listing06.06.AccessingFields.cs | 10 +++++----- .../Listing09.16.OverridingToString.Tests.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Chapter06/Listing06.06.AccessingFields.cs b/src/Chapter06/Listing06.06.AccessingFields.cs index 7bc5c8a6..1ffc8be3 100644 --- a/src/Chapter06/Listing06.06.AccessingFields.cs +++ b/src/Chapter06/Listing06.06.AccessingFields.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_06; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_06; using Listing06_05; using System; @@ -18,10 +18,10 @@ public static void Main() employee1.Salary = "Too Little"; IncreaseSalary(employee1); Console.WriteLine( - "{0} {1}: {2}", - employee1.FirstName, - employee1.LastName, - employee1.Salary); + $"{ + employee1.FirstName } { + employee1.LastName }: { + employee1.Salary }"); #endregion HIGHLIGHT // ... } diff --git a/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs b/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs index 57a489bb..0959f871 100644 --- a/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs +++ b/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter09.Listing09_16.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter09.Listing09_16.Tests; using AddisonWesley.Michaelis.EssentialCSharp.Chapter09.Listing09_16; From aff5b87afc82bea695cdd64723eec4a96be63498 Mon Sep 17 00:00:00 2001 From: Mark Michaelis Date: Tue, 5 Sep 2023 11:58:57 +0100 Subject: [PATCH 4/4] Fixed test --- src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs b/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs index 0959f871..06d4fcc6 100644 --- a/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs +++ b/src/Chapter09.Tests/Listing09.16.OverridingToString.Tests.cs @@ -12,8 +12,8 @@ public void Override_ToString_MatchesExpectedValue() Angle angle1 = new(120, 20, 20, "AngleName"); Angle angle2 = new(320, 10, 10, null); - string expected1 = $"AngleName: 120º 20' 20\""; - string expected2 = $"320º 10' 10\""; + string expected1 = $"AngleName: 120° 20' 20\""; + string expected2 = $"320° 10' 10\""; string actual1 = angle1.ToString(); string actual2 = angle2.ToString();