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

Add Appointment tests #97

Conversation

thutahw
Copy link

@thutahw thutahw commented Oct 11, 2020

Added some tests for Appointment.

@thutahw thutahw self-assigned this Oct 11, 2020
@codecov-io
Copy link

Codecov Report

Merging #97 into master will increase coverage by 1.35%.
The diff coverage is n/a.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
...a/seedu/address/model/appointment/Appointment.java 41.17% <0.00%> (+41.17%) 7.00% <0.00%> (+7.00%)
...a/seedu/address/model/appointment/Description.java 42.85% <0.00%> (+42.85%) 1.00% <0.00%> (+1.00%)
...u/address/model/appointment/AppointmentStatus.java 100.00% <0.00%> (+100.00%) 1.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a32a058...6f3c0ad. Read the comment docs.

@jianhandev jianhandev changed the title Update tests in AppointmentTest Add Appointment tests Oct 13, 2020
Comment on lines 22 to 34
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);

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

Comment on lines 56 to 59
assertEquals(apt4, apt1);
// different Patient -> False
assertNotEquals(apt2, apt1);

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

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"),
Copy link

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.

@jianhandev jianhandev closed this Oct 14, 2020
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

3 participants