-
Notifications
You must be signed in to change notification settings - Fork 4
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
Search feature implementation #100
Search feature implementation #100
Conversation
This reverts commit abadae6.
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.
LGTM! Just some minor suggestions.
String moduleCode = StringUtil.ignoreCase(trimmedArgs); | ||
|
||
return new SearchCommand(moduleCode); |
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.
Maybe we can catch the possible IllegalArgumentException error thrown by the StringUtil.ignoreCase() method here so that we can display an error message to the user that something has gone wrong.
Currently if the user types in "search MA 1521", the IllegalArgumentException error is thrown in IntelliJ but not in the GUI. Maybe we can try something like that, but I'm not too sure what error message you would wanna show them hehe
String moduleCode = StringUtil.ignoreCase(trimmedArgs); | |
return new SearchCommand(moduleCode); | |
try { | |
String moduleCode = StringUtil.ignoreCase(trimmedArgs); | |
return new SearchCommand(moduleCode); | |
} | |
catch (IllegalArgumentException e) { | |
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, SearchCommand.MESSAGE_USAGE)); | |
} |
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.
Oh wow good catch! Added the relevant code!
Codecov Report
@@ Coverage Diff @@
## master #100 +/- ##
============================================
+ Coverage 72.58% 72.98% +0.39%
- Complexity 464 479 +15
============================================
Files 80 83 +3
Lines 1419 1462 +43
Branches 146 151 +5
============================================
+ Hits 1030 1067 +37
- Misses 312 317 +5
- Partials 77 78 +1
Continue to review full report at Codecov.
|
# Conflicts: # src/main/java/seedu/address/logic/parser/GradPadParser.java
# Conflicts: # src/main/java/seedu/address/logic/parser/GradPadParser.java
LRGTM! super well done 👍🏽 👍🏽 |
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.
Really really clean code bro 💯 Just a few really really minor comments :D
And although you asked about how to improve your testing, I actually think your testing is damn efficient man. Test coverage for the code you've written is almost 100% :O The only test gap is the test for the searchCommand
branch in GradPadParser
😁
Search Feature:
SearchCommand:
Uses ModuleInfoSearcher to perform search for ModuleInfo of the module being searched for.
Returns the string format of the module information to be displayed in the Command Line Interface.
SearchCommandParser:
Parse arguments and uses ignoreCase method of StringUtil to convert all arguments into proper moduleCode format before creating a SearchCommand.
ModuleInfoSearcher:
Contains logic to use NusmodsDataManager API and retrieve ModuleInfo from NUSMods or local saved file.