From b0e7834fd42083c52fd4f894a1046119ae36c60f Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Tue, 26 Jul 2022 10:18:41 -0700 Subject: [PATCH 1/4] Update nuget packages --- src/Chapter03.Tests/Chapter03.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Chapter03.Tests/Chapter03.Tests.csproj b/src/Chapter03.Tests/Chapter03.Tests.csproj index ce049bb6b..3a2d5b05d 100644 --- a/src/Chapter03.Tests/Chapter03.Tests.csproj +++ b/src/Chapter03.Tests/Chapter03.Tests.csproj @@ -7,8 +7,8 @@ - - + + From c7bd8443213303efb65c61071b64197084cb3a4f Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Tue, 26 Jul 2022 10:18:54 -0700 Subject: [PATCH 2/4] Make tests more robust --- ...isting03.02.DereferencingAnUnassignedVariable.Tests.cs | 4 ++-- src/Shared/CompilerAssert.cs | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Chapter03.Tests/Listing03.02.DereferencingAnUnassignedVariable.Tests.cs b/src/Chapter03.Tests/Listing03.02.DereferencingAnUnassignedVariable.Tests.cs index 78ca8a3d2..c9e3c2fad 100644 --- a/src/Chapter03.Tests/Listing03.02.DereferencingAnUnassignedVariable.Tests.cs +++ b/src/Chapter03.Tests/Listing03.02.DereferencingAnUnassignedVariable.Tests.cs @@ -14,9 +14,9 @@ public class UppercaseTests [TestMethod] async public Task UnassignedVariableThrowsError() { - CompileError[] compileErrors = await CompilerAssert.ExpectErrorsInFileAsync( + _ = await CompilerAssert.ExpectErrorsInFileAsync( "Listing03.02.DereferencingAnUnassignedVariable.cs", - new CompileError("CS0165: Use of unassigned local variable 'text'")); + new CompileError("CS0165", "Use of unassigned local variable 'text'")); } } } diff --git a/src/Shared/CompilerAssert.cs b/src/Shared/CompilerAssert.cs index 8cd360daf..2710ea5c4 100644 --- a/src/Shared/CompilerAssert.cs +++ b/src/Shared/CompilerAssert.cs @@ -105,16 +105,10 @@ async static public Task ExpectErrorsAsync( for (int i = 0; i < actualCompileErrors.Length; i++) { // Compare Id's first as that is more meaningful. - Assert.AreEqual(diagnostics[i].Message, actualCompileErrors[i].Message, - $"The expected Messages do not match for item {i}: " + - $"{diagnostics[i].Message} <> {diagnostics[i].Message}"); Assert.AreEqual(diagnostics[i].Id, actualCompileErrors[i].Id, $"The expected Ids do not match for item {i}: " + - $"{diagnostics[i].Id} <> {actualCompileErrors[i].Id}"); + $"{diagnostics[i].Id}: {diagnostics[i].Message} <> {actualCompileErrors[i].Id}: {actualCompileErrors[i].Message}"); } - //CollectionAssert.AreEquivalent( - // diagnostics, - // actualCompileErrors.ToList()); } return actualCompileErrors; } From 5b03f15a0dcc3d58c2582d30e81248750fccab39 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Tue, 26 Jul 2022 10:22:32 -0700 Subject: [PATCH 3/4] Update readme badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 993080856..71281d07b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # EssentialCSharp -[![Build and Test v9.0](https://github.com/IntelliTect/EssentialCSharp/actions/workflows/Branch%20v9.0.yml/badge.svg)](https://github.com/IntelliTect/EssentialCSharp/actions/workflows/Branch%20v9.0.yml) +[![Build and Test v9.0](https://github.com/IntelliTect/EssentialCSharp/actions/workflows/Branch%20v9.0.yml/badge.svg?branch=v9.0&event=push)](https://github.com/IntelliTect/EssentialCSharp/actions/workflows/Branch%20v9.0.yml) This project contains the source code for the book **Essential C#** by Mark Michaelis (Addison-Wesley). From 8f14f8590794e81ad4c1d1bc8f7151537628d06a Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Tue, 26 Jul 2022 13:17:59 -0700 Subject: [PATCH 4/4] Update Visual Studio version --- EssentialCSharp.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EssentialCSharp.sln b/EssentialCSharp.sln index f5760ecf4..30019a8a5 100644 --- a/EssentialCSharp.sln +++ b/EssentialCSharp.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29319.158 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32616.157 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F97BC459-B5B9-4326-9E0D-D085FD4DEF96}" ProjectSection(SolutionItems) = preProject