diff --git a/src/test/java/bookbob/functions/CommandHandlerTest.java b/src/test/java/bookbob/functions/CommandHandlerTest.java index 8a9de9e35..64e69784c 100644 --- a/src/test/java/bookbob/functions/CommandHandlerTest.java +++ b/src/test/java/bookbob/functions/CommandHandlerTest.java @@ -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")); } @@ -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 19-11-2024 " + "18:00 with Patient Helen Smith, S7654321A."; command.listAppointments(appointmentRecord); assertEquals(expectedOutput, outputStreamCaptor.toString().trim().replace(System.lineSeparator(), @@ -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")); @@ -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")); @@ -1013,11 +1013,11 @@ 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.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/18-11-2024", appointmentRecord); assertEquals(expectedOutput, outputStreamCaptor.toString().trim().replace(System.lineSeparator(), "\n")); @@ -1026,11 +1026,11 @@ void testFindAppointment_date_oneOutput() throws IOException { //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 19-11-2024 " + "18:00 with Patient Helen Smith, S7654321A."; command.findAppointment("time/18:00", appointmentRecord); assertEquals(expectedOutput, outputStreamCaptor.toString().trim().replace(System.lineSeparator(),