-
Notifications
You must be signed in to change notification settings - Fork 233
[CS2113-F14-3] VoyaTrip #39
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: master
Are you sure you want to change the base?
Conversation
Hamdhan Junit tests and add assert statements
thomasjlalba
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.
Good work thus far everyone, only have a few really minor suggestions, but I especially like the abstraction to smaller and simpler methods
| } else { | ||
| return "~/" + currentTrip + "/" + currentTarget + " >"; | ||
| } |
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 the else statement is redundant, given it is a return statement.
| } | ||
|
|
||
| private ArrayList<String> extractCommandArguments(String command) throws InvalidCommand { | ||
| String[] doubleHyphenSeparatedTokens = command.strip().split("(^--|\\s+--)(?=\\w+\\s+\\w+)"); |
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 it would be good to refactor the regex to make it more understandable and less of a magic literal
src/main/java/voyatrip/Trip.java
Outdated
| Ui.printDeleteAccommodationMessage(accommodations.get(index - 1)); | ||
| accommodations.remove(index - 1); |
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.
I think it might be clearer if you indicate with a comment why it is index - 1
src/main/java/voyatrip/Trip.java
Outdated
| } | ||
| Transportation newTransportation = new Transportation(transportName, transportMode, transportBudget); | ||
| transportations.add(newTransportation); | ||
| Ui.printAddTransportationMessage(newTransportation); |
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 work on refactoring the magic strings!
src/main/java/voyatrip/Trip.java
Outdated
| } | ||
| } | ||
|
|
||
| public String abbrInfo() { |
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 this is a personal preference, but maybe a more meaningful method name could be used like printAbbreviatedInfo (if I understand the method's intention correctly).
src/main/java/voyatrip/Trip.java
Outdated
| StringBuilder tripInfo = new StringBuilder(); | ||
| tripInfo.append(abbrInfo()).append("\n"); | ||
|
|
||
| tripInfo.append("Itinerary:\n"); |
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 you can look to refactor this magic string
| case "add", "a", "make", "mk" -> CommandAction.ADD; | ||
| case "delete", "d", "remove", "rm" -> CommandAction.DELETE_BY_INDEX; | ||
| case "list", "l" -> CommandAction.LIST; | ||
| case "cd" -> CommandAction.CHANGE_DIRECTORY; | ||
| case "exit", "quit", "bye" -> CommandAction.EXIT; |
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 you can refactor the magic strings to make it clearer, esp for the short forms like l or d
…mmodation Dev/101 Modification of accommodation
Start and end day were not properly set causing program to crash. Verify if start and end day are null to avoid program crashing.
start and end day cannot be null otherwise they will throw InvalidCommand contradicting assertDoesNotThrow
# Conflicts: # src/main/java/voyatrip/VoyaTrip.java
# Conflicts: # src/main/java/voyatrip/Trip.java
Dev/91 add day to transportation
Dev/127 Add purposed storage system sequence diagram
…chiu/tp into fix/153-DevelopmentGuide
Dev/225 ug and dg update
…je-nnyt/tp into dev/242-Finalize-transportation
# Conflicts: # docs/DeveloperGuide.md
Dev/242 finalize transportation
Fix/153 Development Guide
# Conflicts: # docs/UserGuide.md
Dev/225 user guide
Fix/249 indentation
Fix invalid portfolio path
* master: (26 commits) Fix invalid portfolio path Fix: indentation Fix: table of contents not showing properly UserGuide.md: Change error message order Add clarification for table of contents Fix merge conflicts Update user guide Move PlantUML section in DG Apply format changes Update project description in PPP Apply final changes Update RepoSense link Update portfolio link Finalise DG documentation of modifyAccommodation Fix coding style Update DG Add table of cotent Update product profiles DG update Remove empty lines ...
Dev/246 add ppp for Lyam
Dev/246 Add PPP
Fix/253 Restructure the main readme
No description provided.