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

Update JsonAdaptedRecordTest #266

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

longnguyentan
Copy link

Update JsonAdaptedRecordTest

Key changes

  • Update test cases for JsonAdaptedRecordTest and modify JsonAdaptedRecord.java.
  • Add JavaDocs to some files.

* Update test cases for JsonAdaptedRecordTest and modify JsonAdaptedRecord.java.
* Add JavaDocs to some files.
Update personal contribution to Project Portfolio Page (PPP).
Copy link

@AaronJT1 AaronJT1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good job adding the javadocs and nice implementation for the tesing!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job adding the java docs for the methods!!

Comment on lines +65 to +85

@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || getClass() != other.getClass()) {
return false;
}
JsonAdaptedRecord that = (JsonAdaptedRecord) other;
return Objects.equals(patient, that.patient)
&& Objects.equals(initialObservations, that.initialObservations)
&& Objects.equals(diagnosis, that.diagnosis)
&& Objects.equals(treatmentPlan, that.treatmentPlan);
}

@Override
public int hashCode() {
return Objects.hash(patient, initialObservations, diagnosis, treatmentPlan);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation for equals

Comment on lines +38 to +51
// Test with empty strings
JsonAdaptedRecord jsonAdaptedRecord = new JsonAdaptedRecord(
expectedPatient, "", "", "");

// Execution
Record modelRecord = jsonAdaptedRecord.toModelType();

// Verification
assertEquals(expectedPatient, modelRecord.getPatient());
assertEquals("", modelRecord.getInitialObservations());
assertEquals("", modelRecord.getDiagnosis());
assertEquals("", modelRecord.getTreatmentPlan());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how you used the comments to guide developers on the different logics of the method. Good job!

@AaronJT1 AaronJT1 merged commit 044206a into AY2324S1-CS2103T-T14-2:master Nov 13, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants