Skip to content

Commit

Permalink
Merge pull request #277 from wang-h-z/bugFix
Browse files Browse the repository at this point in the history
Fix Message Usages
  • Loading branch information
wang-h-z authored Nov 8, 2024
2 parents 93161ed + 72d750b commit 4f92dc8
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class DeleteClientProfileCommand extends Command {
public static final String COMMAND_WORD = "deleteclient";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the client profile corresponding to the client's name.\n"
+ ": Deletes the client identified by the index number used in the displayed person list.\n"
+ "Parameters: INDEX (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class EditClientCommand extends Command {
public static final String COMMAND_WORD = "editclient";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the person identified "
+ "by their name. "
+ "by the index number used in the displayed person list. "
+ "Existing values will be overwritten by the input values.\n"
+ "Parameters: INDEX (must be a positive integer) "
+ "[" + PREFIX_NAME + "NAME] "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AddAppointmentCommand extends Command {
public static final String COMMAND_WORD = "apt";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds an appointment to a client "
+ "identified by their distinct client name. "
+ "identified by the index number used in the displayed person list. "
+ "Existing appointment will be overwritten with the new appointment. \n"
+ "Parameters: INDEX (must be a positive integer) "
+ PREFIX_DATE + " [DATE in ddMMyy] "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
* The name must correspond to a person in the current list of persons.
*/
public class DeleteAppointmentCommand extends Command {
public static final String COMMAND_WORD = "delapt";
public static final String COMMAND_WORD = "deleteapt";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the appointment corresponding to the client's name.\n"
+ ": Deletes the appointment identified by the index number used in the displayed person list.\n"
+ "Parameters: INDEX (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1 ";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DeleteListingCommand extends Command {
public static final String COMMAND_WORD = "deletelisting";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the listing specified by its index.\n"
+ ": Deletes the listing identified by its index number used in the displayed listing list.\n"
+ "Parameters: LISTING_INDEX\n"
+ "Example: " + COMMAND_WORD + " 1";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class EditListingCommand extends Command {
public static final String COMMAND_WORD = "editlisting";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the listing identified "
+ "by the listing index. Buyers cannot be edited using this command. "
+ "by the listing index number. Buyers cannot be edited using this command. "
+ "Use addlistingbuyers or removelistingbuyers to manage buyers.\n"
+ "Parameters: LISTING_INDEX "
+ "[" + PREFIX_NAME + "NAME] "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class RemoveBuyersFromListingCommand extends Command {
public static final String COMMAND_WORD = "removelistingbuyers";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Removes buyers from the listing identified by its "
+ "index. "
+ "index number used in the displayed listing list "
+ "Parameters: LISTING_INDEX buy/BUYER_INDEX [buy/MORE_BUYER_INDEXES]...\n"
+ "Example: " + COMMAND_WORD + " 1 buy/1 buy/3";

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/ui/ChatWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public String getResponse(String message) {
} else if (Pattern.compile("\\b(d+e+l+e+t+e+|deleted|deleting|deletes)\\b.*a+p+o+i+n+t+m+e+n+t+\\b")
.matcher(message).find()) {
return "This is how to delete an appointment!\n"
+ "delapt {index}";
+ "deleteapt {index}";
} else if (Pattern.compile("\\b(d+e+l+e+t+e+|deleted|deleting|deletes)\\b.*l+i+s+t+i+n+g+\\b")
.matcher(message).find()) {
return "This is how to delete a listing!\n"
Expand Down Expand Up @@ -240,7 +240,7 @@ public String getResponse(String message) {
return "I assume you are having trouble with the delete command.\n"
+ "Can you help specify which you are referring to?\n"
+ "• Deleting a buyer/seller client profile - deleteclient\n"
+ "• Deleting an appointment - delapt\n"
+ "• Deleting an appointment - deleteapt\n"
+ "• Deleting a listing - deletelisting\n"
+ "• Deleting a buyer from a listing - removelistingbuyers";
} else if (Pattern.compile("\\b(a+d+d+|adding|adds)\\b").matcher(message).find()) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/seedu/address/ui/ChatWindowUiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void getResponse_deleteKeyword_success() {
assertEquals("I assume you are having trouble with the delete command.\n"
+ "Can you help specify which you are referring to?\n"
+ "• Deleting a buyer/seller client profile - deleteclient\n"
+ "• Deleting an appointment - delapt\n"
+ "• Deleting an appointment - deleteapt\n"
+ "• Deleting a listing - deletelisting\n"
+ "• Deleting a buyer from a listing - removelistingbuyers",
chatWindow.getResponse("delete"));
Expand Down Expand Up @@ -179,7 +179,7 @@ public void getResponse_deleteSeller_success() {
@Order(13)
public void getResponse_deleteAppointment_success() {
assertEquals("This is how to delete an appointment!\n"
+ "delapt {index}",
+ "deleteapt {index}",
chatWindow.getResponse("delete appointment"));
}

Expand Down

0 comments on commit 4f92dc8

Please sign in to comment.