-
Notifications
You must be signed in to change notification settings - Fork 27
[USER STORY] Add input validation to WordGuessGame #25 #144
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
base: main
Are you sure you want to change the base?
Conversation
name Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Update README.md
added name
added my name
add if Score == null Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Update GameHistoryTracker.java
Signed-off-by: CamCranda11 <159499223+CamCranda11@users.noreply.github.com>
Signed-off-by: CamCranda11 <159499223+CamCranda11@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
Signed-off-by: hchagerman <123512775+hchagerman@users.noreply.github.com>
jody
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does input validation to WordGuessGame involve changes to JottoGame.java?
|
|
||
| public String GuessData(String guess){ | ||
| int guessLength = guess.length(); | ||
| if (guessLength != 5 || !guess.matches("[a-zA-Z0-9]{5}")){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are numerals included in input validation? The Acceptance Criteria for #25 indicates that only "alphabetic" inputs are accepted and more specifically: "reject inputs that contain numbers".
| public String GuessData(String guess){ | ||
| int guessLength = guess.length(); | ||
| if (guessLength != 5 || !guess.matches("[a-zA-Z0-9]{5}")){ | ||
| System.out.println("your guess needs to be 5 letters long"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the guess is length 5 but contains non-letters, this is a misleading error message.
| assertTrue(result.isPresent()); | ||
| assertEquals(5, result.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this test whether input is valid or not?
|
Too many commits to review; not all appear to be relevant. |

[USER STORY] Add input validation to WordGuessGame
#25
added the code to allow the user to input only a 5-letter word in word guess game
also added test cases to test more aspects of the problem to ensure proper working order
all test cases with this current issue have passed that don't need a loop (future issue)