diff --git a/src/Chapter04.Tests/Listing04.24.Tests.cs b/src/Chapter04.Tests/Listing04.24.Tests.cs index cfd1b5f2e..979a54c6b 100644 --- a/src/Chapter04.Tests/Listing04.24.Tests.cs +++ b/src/Chapter04.Tests/Listing04.24.Tests.cs @@ -6,13 +6,13 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_24.Tests; public class ProgramTests { [TestMethod] - public void Main_Input8_ExitProgram() + public void Main_InputNegative1_ExitProgram() { const string expected = "Exiting"; ConsoleAssert.Expect( - expected, ()=>Program.Main("8")); + expected, ()=>Program.Main("-1")); } [TestMethod] @@ -24,4 +24,14 @@ public void Main_Input10_ProgramDoesNotExit() ConsoleAssert.Expect( expected, ()=>Program.Main("10")); } + + [TestMethod] + public void Main_Input0_ProgramDoesNotExit() + { + const string expected = + ""; + + ConsoleAssert.Expect( + expected, () => Program.Main("0")); + } } diff --git a/src/Chapter04/Listing04.24.NoCodeBlock.cs b/src/Chapter04/Listing04.24.NoCodeBlock.cs index 395bef295..4c9b08912 100644 --- a/src/Chapter04/Listing04.24.NoCodeBlock.cs +++ b/src/Chapter04/Listing04.24.NoCodeBlock.cs @@ -7,10 +7,10 @@ public static void Main(params string[] args) int input = int.Parse(args[0]); #region INCLUDE - if (input < 9) + if (input < 0) #region HIGHLIGHT Console.WriteLine("Exiting"); - #endregion HIGHLIGHT + #endregion HIGHLIGHT #endregion INCLUDE } }