Skip to content
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

Add unit tests for edit meeting and parser #124

Merged
merged 29 commits into from
Mar 24, 2024

Conversation

timothysashimi
Copy link

No description provided.

timothysashimi and others added 25 commits March 20, 2024 11:17
Add unit tests for edit meeting and parser
Copy link

codecov bot commented Mar 23, 2024

Codecov Report

Attention: Patch coverage is 77.94118% with 30 lines in your changes are missing coverage. Please review.

Project coverage is 74.29%. Comparing base (0839077) to head (09c0535).
Report is 16 commits behind head on master.

Files Patch % Lines
...address/logic/parser/EditMeetingCommandParser.java 34.61% 17 Missing ⚠️
...edu/address/logic/commands/EditMeetingCommand.java 86.07% 2 Missing and 9 partials ⚠️
...a/seedu/address/logic/commands/MeetingCommand.java 0.00% 1 Missing ⚠️
.../seedu/address/logic/parser/AddressBookParser.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #124      +/-   ##
============================================
+ Coverage     72.59%   74.29%   +1.69%     
- Complexity      512      547      +35     
============================================
  Files            85       88       +3     
  Lines          1704     1832     +128     
  Branches        175      193      +18     
============================================
+ Hits           1237     1361     +124     
+ Misses          418      414       -4     
- Partials         49       57       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Add unit tests for edit meeting and parser
Comment on lines +30 to +42
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the meeting identified "
+ "by the index number used in the displayed meeting list. "
+ "Existing values will be overwritten by the input values.\n"
+ "Parameters: INDEX (must be a positive integer) "
+ PREFIX_CLIENT_INDEX + "CLIENT INDEX "
+ PREFIX_MEETING_INDEX + "MEETING INDEX "
+ PREFIX_NAME + "NAME "
+ PREFIX_DATETIME + "DATETIME \n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_CLIENT_INDEX + "1 "
+ PREFIX_MEETING_INDEX + "2 "
+ PREFIX_NAME + "starbucks meeting "
+ PREFIX_DATETIME + "01-01-2024 12:00 ";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good that the format for the usage message conforms to the format of the other commands/

Comment on lines 23 to 25
/**
* Parses input arguments and creates a new EditCommand object
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you meant EditMeetingCommand here?

Comment on lines 102 to 105
/**
* Creates and returns a {@code Person} with the details of {@code personToEdit}
* edited with {@code editPersonDescriptor}.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to update the javadocs for your code!

Comment on lines 53 to 57
/**
* @param clientIndex of the person in the filtered person list to edit
* @param meetingIndex of the meeting in the filtered meeting list to edit
* @param editPersonDescriptor details to edit the person with
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you meant to type meetingIndex and editMeetingDescriptor?

* @param meetingIndex of the meeting in the filtered meeting list to edit
* @param editPersonDescriptor details to edit the person with
*/
public EditMeetingCommand(Index clientIndex, EditMeetingDescriptor editPersonDescriptor, Index meetingIndex) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe your variables could be named differently since it's the meeting we are editing, not the client.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the javadocs for this file could be rewritten and the variable names updated?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the javadocs could be updated for this file.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only left with a few javadocs to update and maybe some variable names could be more appropriate.

* @param meetingIndex of the meeting in the filtered meeting list to edit
* @param editMeetingDescriptor details to edit the meeting with
*/
public EditMeetingCommand(Index clientIndex, EditMeetingDescriptor editMeetingDescriptor, Index meetingIndex) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of utility methods provided by address book to check for non null

* Stores the details to edit the meeting with. Each non-empty field value will replace the
* corresponding field value of the meeting.
*/
public static class EditMeetingDescriptor {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting way to approach the problem, could you explain your thought process for creating a static class and using optionals?

@chewbum chewbum merged commit e773486 into AY2324S2-CS2103-F08-1:master Mar 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants