-
Notifications
You must be signed in to change notification settings - Fork 36
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
[W7][T11-2]Li Guanlong #40
base: master
Are you sure you want to change the base?
Conversation
This is a useful feature to prevent unwanted people from using the addressbook |
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.
Hi Guan Long,
For 3kLoc, you are only required to submit one enhancement, not your team code.
I'm not able to assess which particular enhancement you have done from this submission.
You may close the PR after reviewing the 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.
Hi Guan Long,
Good work here in the login enhancement, updating the documentation and in providing the unit tests for the new enhancement. One thing to note: Header Comments are important, for code readability; you have missed that out in several of the new non-trivial methods.
See coding standard conventions for more information on what is required: https://nuscs2113-ay1819s2.github.io/website/coding-standards/java/intermediate.html
public boolean getLoginStatus(){ | ||
return loginStatus; | ||
} | ||
|
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.
Missing header comment. All non-trivial methods should have java doc format header comments.
public String checkLoginInfo(String userCommandText){ | ||
String[] accountInfo = userCommandText.split(" "); | ||
try { | ||
if (accountInfo.length == 3 && accountInfo[0].equals("login")) { |
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.
You could apply some refactoring principles here. Multi-condition criteria could be extracted into booleans.
private static final String Invalid_FORMAT = "Please input the correct login command: login username password"; | ||
private Login login = new Login(); | ||
|
||
@Test |
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.
Missing header comment. All non-trivial methods should have java doc format header comments.
assertEquals(login.getLoginStatus(), true); | ||
} | ||
|
||
@Test |
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.
Missing header comment. All non-trivial methods should have java doc format header comments.
assertEquals(login.getLoginStatus(), false); | ||
} | ||
|
||
@Test |
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.
Missing header comment. All non-trivial methods should have java doc format header comments.
final String input1 = "login guanlong 12345"; | ||
final String input2 = "some_random_string"; | ||
final String input3 = "login wrong_username wrong_password"; | ||
assertEquals(login.checkLoginInfo(input1), SUCCESS); |
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.
Good job here, providing the positive and negative test cases.
Add Match Management
Added a new command: login, which is used for the user to login to the system before actually using the address book.