Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter13.15 bug fix #794

Merged
merged 7 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Errata.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ Zhou Jing | 23 | 1080 | Change "DWORD flProtect); // The type of memory allocati
Zhou Jing | 22 | 1065 - 1066 | Changed 'Thread' to 'Task' and "Application exiting" to "Application shutting down"
Zhou Jing | 4 | 161 | Fix `input < 9` to `input < 0` in Listing 4.24
Zhou Jing | 4 | 119 | Show inconsistent size multi-dimensional array in listing 3.16
Zhou Jing | 3 | 114 | Replace `second` with `third` in "// Retrieve third item from the end (Python)"
Zhou Jing | 3 | 114 | Replace `second` with `third` in "// Retrieve third item from the end (Python)"
Tyler Woody | 13 | 702 | Remove the `!` negation in `string.IsNullOrWhiteSpace(input)` in the while loop to properly allow looping
15 changes: 15 additions & 0 deletions src/Chapter13.Tests/Listing13.15.Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter13.Listing13_15.Tests;

[TestClass]
public class ProgramTests
{
[TestMethod]
public void MainTest()
BenjaminMichaelis marked this conversation as resolved.
Show resolved Hide resolved
{
const string expected = "<<ValidInput>>ValidInput";

IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, Program.Main
);
}
}
5 changes: 3 additions & 2 deletions src/Chapter13/Listing13.15.ParameterlessStatementLambdas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ public static void Main()
{
input = Console.ReadLine();
}
while(!string.IsNullOrWhiteSpace(input));
while(string.IsNullOrWhiteSpace(input));
return input!;
};
//...
#endregion INCLUDE
getUserInput();
string input = getUserInput();
Console.WriteLine(input);
}
}
Loading