Updated Chapter 6 with nullability
MODIFY
src/Chapter06.Tests/Listing06.06.AccessingFields.cs
src/Chapter06.Tests/Listing06.06.AccessingFields.cs
@@ -5,9 +5,13 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_06.Tests
[TestClass]
public class ProgramTests
{
+ [System.Diagnostics.CodeAnalysis.NotNull]
+ public TestContext? TestContext { get; set; }
+
[TestMethod]
public void Main_AccessingFields_WriteFieldValues()
{
+ Assert.IsNotNull(TestContext);
const string expected =
@"Inigo Montoya: Enough to survive on";

MODIFY
src/Chapter06/Listing06.31.OverloadingAConstructor.cs
src/Chapter06/Listing06.31.OverloadingAConstructor.cs
@@ -35,8 +35,11 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_31
// ...
}
}
-
+ [System.Diagnostics.CodeAnalysis.NotNull]
+ [System.Diagnostics.CodeAnalysis.DisallowNull]
public string FirstName { get; set; }
+ [System.Diagnostics.CodeAnalysis.DisallowNull]
+ [System.Diagnostics.CodeAnalysis.NotNull]
public string LastName { get; set; }
public string? Salary { get; set; } = "Not Enough";

Updated Chapter 6 with nullability