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

fix Typos in UG #410

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Format: find Prefix/Value where Prefix can be:
- mh/MEDICAL_HISTORY <br>
<br>
**Note** : <br>
- Trailing spaces are fine, but there are <u>no spaces</u> anywhere in <u>between Prefix/Value</u>. <br>
- "find" Trims Leading spaces and Trailing spaces. But there are <u>no spaces</u> anywhere in <u>between Prefix/Value</u>. <br>

Examples:
* `find n/John` - Finds all patients whose names contain "John"
Expand Down Expand Up @@ -321,7 +321,7 @@ Name: James Ho, NRIC: S9534567A, Phone: 80976890, Address: , DOB: , Allergy: [Po
```

Additional examples:
* `edit ic/S9890897U dob/31-01-1990 ha/Orchard Road` - Edit a patient record with optional fields in a different order than the format shown above.
* `edit ic/S9890897U /to dob/31-01-1990 ha/Orchard Road` - Edit a patient record with optional fields in a different order than the format shown above.

The examples above result in successful patient record updates, which are automatically saved.

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bookbob/functions/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void help() {
+-------------+---------------------------------------+---------------------------------+
| Add | add n/NAME ic/NRIC [p/PHONE_NUMBER] | add n/James Ho ic/S9534567A |
| | [d/DIAGNOSIS] [m/MEDICATION] | p/91234567 d/Asthma m/Albuterol |
| | [ha/HOME_ADDRESS] [dob/DATE_OF_BIRTH] | ha/NUS-PGPR dob/01011990 |
| | [ha/HOME_ADDRESS] [dob/DATE_OF_BIRTH] | ha/NUS-PGPR dob/21-05-1990 |
| | [v/VISIT_DATE_TIME] [al/ALLERGY] | v/21-10-2024 15:48 al/Pollen |
| | [s/SEX] [mh/MEDICALHISTORY] | s/Female mh/Diabetes |
| | DATE format: dd-mm-yyyy | |
Expand Down
64 changes: 32 additions & 32 deletions src/test/java/bookbob/functions/CommandHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void helpCommand_noInput_outputsCommandHelp() {
"+-------------+---------------------------------------+---------------------------------+\n" +
"| Add | add n/NAME ic/NRIC [p/PHONE_NUMBER] | add n/James Ho ic/S9534567A |\n" +
"| | [d/DIAGNOSIS] [m/MEDICATION] | p/91234567 d/Asthma m/Albuterol |\n" +
"| | [ha/HOME_ADDRESS] [dob/DATE_OF_BIRTH] | ha/NUS-PGPR dob/01011990 |\n" +
"| | [ha/HOME_ADDRESS] [dob/DATE_OF_BIRTH] | ha/NUS-PGPR dob/21-05-1990 |\n" +
"| | [v/VISIT_DATE_TIME] [al/ALLERGY] | v/21-10-2024 15:48 al/Pollen |\n" +
"| | [s/SEX] [mh/MEDICALHISTORY] | s/Female mh/Diabetes |\n" +
"| | DATE format: dd-mm-yyyy | |\n" +
Expand Down Expand Up @@ -888,8 +888,8 @@ void editCommand_nricInputtedNotInRecord_noPatientFoundMessageGetsPrinted() thro
//@@author G13nd0n
@Test
void testAppointment_onePatient_onePatient() throws IOException {
command.appointment("n/John Doe ic/S1234567A date/18-11-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A has been added.";
command.appointment("n/John Doe ic/S1234567A date/28-12-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A has been added.";
assertEquals(expectedOutput,
outputStreamCaptor.toString().trim().replace(System.lineSeparator(), "\n"));
}
Expand Down Expand Up @@ -964,20 +964,20 @@ void editVisitCommand_editVisitDateOnlyWithCorrectInputFormat_editVisitSuccessfu
//@@author G13nd0n
@Test
void testdeleteAppointment_onePatient_onePatient() throws IOException {
command.appointment("n/John Doe ic/S1234567A date/18-11-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/19-11-2024 time/18:00", appointmentRecord);
command.deleteAppointment("ic/S1234567A date/18-11-2024 time/18:00", appointmentRecord);
command.appointment("n/John Doe ic/S1234567A date/28-12-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/29-12-2024 time/18:00", appointmentRecord);
command.deleteAppointment("ic/S1234567A date/28-12-2024 time/18:00", appointmentRecord);
assertEquals(1, appointmentRecord.getAppointments().size());
}

//author G13nd0n
@Test
void testlistAppointment_noInput_multipleOutput() throws IOException {
command.appointment("n/John Doe ic/S1234567A date/18-11-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/19-11-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 19-11-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A.\n" + "Appointment on 19-11-2024 " +
command.appointment("n/John Doe ic/S1234567A date/28-12-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/29-12-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 29-12-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A.\n" + "Appointment on 29-12-2024 " +
"18:00 with Patient Helen Smith, S7654321A.";
command.listAppointments(appointmentRecord);
assertEquals(expectedOutput, outputStreamCaptor.toString().trim().replace(System.lineSeparator(),
Expand All @@ -987,11 +987,11 @@ void testlistAppointment_noInput_multipleOutput() throws IOException {
//author G13nd0n
@Test
void testFindAppointment_name_oneOutput() throws IOException {
command.appointment("n/John Doe ic/S1234567A date/18-11-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/19-11-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 19-11-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A.";
command.appointment("n/John Doe ic/S1234567A date/28-12-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/29-12-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 29-12-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A.";
command.findAppointment("n/John Doe", appointmentRecord);
assertEquals(expectedOutput, outputStreamCaptor.toString().trim().replace(System.lineSeparator(),
"\n"));
Expand All @@ -1000,11 +1000,11 @@ void testFindAppointment_name_oneOutput() throws IOException {
//author G13nd0n
@Test
void testFindAppointment_nric_oneOutput() throws IOException {
command.appointment("n/John Doe ic/S1234567A date/18-11-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/19-11-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 19-11-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A.";
command.appointment("n/John Doe ic/S1234567A date/28-12-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/29-12-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 29-12-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A.";
command.findAppointment("ic/S1234567A", appointmentRecord);
assertEquals(expectedOutput, outputStreamCaptor.toString().trim().replace(System.lineSeparator(),
"\n"));
Expand All @@ -1013,24 +1013,24 @@ void testFindAppointment_nric_oneOutput() throws IOException {
//author G13nd0n
@Test
void testFindAppointment_date_oneOutput() throws IOException {
command.appointment("n/John Doe ic/S1234567A date/18-11-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/19-11-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 19-11-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A.";
command.findAppointment("date/18-11-2024", appointmentRecord);
command.appointment("n/John Doe ic/S1234567A date/28-12-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/29-12-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 29-12-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A.";
command.findAppointment("date/28-12-2024", appointmentRecord);
assertEquals(expectedOutput, outputStreamCaptor.toString().trim().replace(System.lineSeparator(),
"\n"));
}

//author G13nd0n
@Test
void testFindAppointment_time_twoOutput() throws IOException {
command.appointment("n/John Doe ic/S1234567A date/18-11-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/19-11-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 19-11-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 18-11-2024 18:00 with Patient John Doe, S1234567A.\n" + "Appointment on 19-11-2024 " +
command.appointment("n/John Doe ic/S1234567A date/28-12-2024 time/18:00", appointmentRecord);
command.appointment("n/Helen Smith ic/S7654321A date/29-12-2024 time/18:00", appointmentRecord);
String expectedOutput = "Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A has been added.\n" +
"Appointment on 29-12-2024 18:00 with Patient Helen Smith, S7654321A has been added.\n" +
"Appointment on 28-12-2024 18:00 with Patient John Doe, S1234567A.\n" + "Appointment on 29-12-2024 " +
"18:00 with Patient Helen Smith, S7654321A.";
command.findAppointment("time/18:00", appointmentRecord);
assertEquals(expectedOutput, outputStreamCaptor.toString().trim().replace(System.lineSeparator(),
Expand Down