PR Code Review Updates
MODIFY
src/Chapter04.Tests/Listing04.24.Tests.cs
src/Chapter04.Tests/Listing04.24.Tests.cs
@@ -4,7 +4,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_24.Tests
{
[TestClass]
- public class Listing04_23_Tests
+ public class ProgramTests
{
[TestMethod]
public void Main_Input8_ExitProgram()

MODIFY
src/Chapter04.Tests/Listing04.34.Tests.cs
src/Chapter04.Tests/Listing04.34.Tests.cs
@@ -5,8 +5,9 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_34.Tests
[TestClass]
public class ProgramTests
{
+ // Fulfills left side of AND but not right
[TestMethod]
- public void Main_Enter25ForHourOfDay_AndConditionFails() // fulfills left side of AND but not right
+ public void Main_Enter25ForHourOfDay_AndConditionFails()
{
const string expected =
@"";
@@ -15,8 +16,9 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_34.Tests
expected, () => Program.Main("25"));
}
+ // Fulfills right side of AND but not left
[TestMethod]
- public void Main_Enter5ForHourOfDay_AndConditionFails() // fulfills right side of AND but not left
+ public void Main_Enter5ForHourOfDay_AndConditionFails()
{
const string expected =
@"";
@@ -25,8 +27,9 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_34.Tests
expected, () => Program.Main("5"));
}
+ // Fulfills both sides of AND
[TestMethod]
- public void Main_Enter22ForHourOfDay_AndConditionSatisfied() // fulfills both sides of AND
+ public void Main_Enter22ForHourOfDay_AndConditionSatisfied()
{
const string expected =
@"Hi-Ho, Hi-Ho, it's off to work we go.";

MODIFY
src/Chapter04.Tests/Listing04.38.Tests.cs
src/Chapter04.Tests/Listing04.38.Tests.cs
@@ -35,23 +35,5 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_38.Tests
IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, () => Program.Main(new[] { "first", "second", "third" }));
}
-
- [TestMethod]
- public void MyTestMethod()
- {
- string? uri = null;
-
- if (uri is object thing)
- {
- System.Console.WriteLine(
- $"Uri is: { thing }");
- }
- else // (uri is null)
- {
- System.Console.WriteLine(
- "Uri is null");
- }
-
- }
}
}

MODIFY
src/Chapter04/Listing04.20.ConstantInterpolatedStrings.cs
src/Chapter04/Listing04.20.ConstantInterpolatedStrings.cs
-#pragma warning disable CS0168 // Variable is declared but never used
-#pragma warning disable CS0219 // Variable is assigned but its value is never used
-#pragma warning disable IDE0059 // Unnecessary assignment of a value
-
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_20
{
public class FortyTwo

MODIFY
src/Chapter04/Listing04.28.OutOfScope.cs
src/Chapter04/Listing04.28.OutOfScope.cs
@@ -28,14 +28,14 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_28
// ...
}
#endregion INCLUDE
- #if INCLUDE
+ #if COMPILE_ERRR
#region INCLUDE
#region HIGHLIGHT
// ERROR: message is not in scope:
Console.WriteLine(message);
#endregion HIGHLIGHT
#endregion INCLUDE
- #endif // INCLUDE
+ #endif // COMPILE_ERRR
}
}
}

PR #396 Code Review Updates