Skip to content

Commit

Permalink
Merge pull request AY2324S2-CS2103T-T15-1#244 from alfaloo/debug
Browse files Browse the repository at this point in the history
Minor issues
  • Loading branch information
Kappaccinoh authored Apr 15, 2024
2 parents b90c356 + 6662ca9 commit 828cfe8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ MediCLI is operated using typed commands to the command line interface (CLI). Do

### Quick Tutorial on a Sample Use Case

1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.<br>'
1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.<br>

<div markdown="span" class="alert alert-danger">:exclamation: **DANGER**: If you are using a PDF version of this document, be careful when copying and pasting commands that span multiple lines as space characters surrounding line breaks may be omitted when copied over to the application.</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ public EditAppointmentDescriptor() {}
* A defensive copy of {@code tags} is used internally.
*/
public EditAppointmentDescriptor(EditAppointmentDescriptor toCopy) {
if (toCopy == null) { // Defensive Coding
throw new IllegalArgumentException();
}
setDateTime(toCopy.apptdatetime);
setDoctorNric(toCopy.doctorNric);
setPatientNric(toCopy.patientNric);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ public EditPersonDescriptor() {
* A defensive copy of {@code tags} is used internally.
*/
public EditPersonDescriptor(EditPersonDescriptor toCopy) {
if (toCopy == null) { // Defensive Coding
throw new IllegalArgumentException();
}
setName(toCopy.name);
setPhone(toCopy.phone);
setNric(toCopy.nric);
Expand Down
9 changes: 5 additions & 4 deletions src/test/java/seedu/address/logic/LogicManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
import seedu.address.model.ModelManager;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.UserPrefs;
import seedu.address.model.appointment.Appointment;
import seedu.address.model.appointment.AppointmentDateTime;
import seedu.address.model.person.Doctor;
import seedu.address.model.person.Patient;
import seedu.address.model.person.Person;
import seedu.address.storage.JsonAddressBookStorage;
import seedu.address.storage.JsonUserPrefsStorage;
import seedu.address.storage.StorageManager;
import seedu.address.testutil.AppointmentBuilder;
import seedu.address.testutil.PatientBuilder;
public class LogicManagerTest {
private static final IOException DUMMY_IO_EXCEPTION = new IOException("dummy IO exception");
Expand Down Expand Up @@ -100,8 +101,8 @@ public void getFilteredAppointmentList_modifyList_throwsUnsupportedOperationExce
public void getAppointmentList_getList_listIsNotNull() throws ParseException {
model.addPerson(ALICE);
model.addPerson(BROWN);
model.addAppointment(
new Appointment(BROWN.getNric(), ALICE.getNric(), new AppointmentDateTime("2024-11-11 11:02"), false));
model.addAppointment(new AppointmentBuilder().withDoctor((Doctor) BROWN)
.withPatient((Patient) ALICE).withDateTime("2024-11-11 11:02").build());
assertTrue(model.getFilteredAppointmentList() != null);
assertTrue(model.getFilteredAppointmentList().size() == 1);
}
Expand Down

0 comments on commit 828cfe8

Please sign in to comment.