-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add Appointment tests #97
Add Appointment tests #97
Conversation
Codecov Report
@@ Coverage Diff @@
## master #97 +/- ##
============================================
+ Coverage 63.89% 65.24% +1.35%
- Complexity 404 413 +9
============================================
Files 86 86
Lines 1407 1407
Branches 142 142
============================================
+ Hits 899 918 +19
+ Misses 471 448 -23
- Partials 37 41 +4
Continue to review full report at Codecov.
|
private final LocalDateTime dateTimeOne = LocalDateTime.parse("2020-10-11T12:45:30"); | ||
private final LocalDateTime dateTimeTwo = LocalDateTime.parse("2002-11-11T11:30:20"); | ||
private final Description description = new Description("long term patient"); | ||
private final Set<Tag> tagSet = new HashSet<>(); | ||
|
||
private final Appointment apt1 = new Appointment(ALICE, dateTimeOne, tagSet, description, | ||
AppointmentStatus.DONE); | ||
private final Appointment apt2 = new Appointment(BOB, dateTimeOne, tagSet, description, | ||
AppointmentStatus.UPCOMING); | ||
private final Appointment apt3 = new Appointment(CARL, dateTimeTwo, tagSet, description, | ||
AppointmentStatus.DONE); | ||
private final Appointment apt4 = new Appointment(ALICE, dateTimeTwo, tagSet, description, | ||
AppointmentStatus.UPCOMING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be moved to a separate util class e.g. TypicalAppointments class
assertEquals(apt4, apt1); | ||
// different Patient -> False | ||
assertNotEquals(apt2, apt1); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can do likewise for description, datetime, status, tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will need an AppointmentBuilder class too
public static final Appointment APT2 = new Appointment(BOB, LocalDateTime.parse("2020-10-11T12:45:30"), | ||
new HashSet<>(), new Description("long term patient"), AppointmentStatus.UPCOMING); | ||
|
||
public static final Appointment APT3 = new Appointment(CARL, LocalDateTime.parse("2002-11-11T11:30:20"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LocalDateTime will have to be updated to use custom DateTime class. Refer to the latest commit.
Added some tests for Appointment.