-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary This pull request addresses an issue in `Chapter13.15.ParameterlessStatementLambdas.cs` where `getUserInput` was only taking white space as input. The method has been updated to ensure that only valid, non-whitespace strings are accepted. ## Changes Made - Removed the Not (`!`) on the while loop condition in `getUserInput` to properly handle whitespace inputs. - Updated 'Main' to call `Console.WriteLine(input);` for testing. - Added unit test to verify correct behavior for valid inputs. --------- Co-authored-by: Benjamin Michaelis <[email protected]>
- Loading branch information
1 parent
07b7eac
commit 99d6952
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
{ | ||
const string expected = "<<ValidInput>>ValidInput"; | ||
|
||
IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
expected, Program.Main | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters