Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kaboomzxc committed Nov 27, 2024
1 parent 7629020 commit 7e9b97f
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions src/test/java/bookbob/functions/CommandHandlerTest.java
Original file line number Diff line number Diff line change
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 19-11-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,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"));
Expand All @@ -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(),
Expand Down

0 comments on commit 7e9b97f

Please sign in to comment.