Skip to content

Commit

Permalink
AM-155: Add getDailyAppointmentBlocks service method that accepts a L…
Browse files Browse the repository at this point in the history
…ist of AppointmentTypes

fix unit test
  • Loading branch information
mogoodrich committed Apr 1, 2014
1 parent 1c8d0a3 commit 701b073
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ public List<ScheduledAppointmentBlock> getDailyAppointmentBlocks(Location locati
@Override
public List<ScheduledAppointmentBlock> getDailyAppointmentBlocks(Location location, Date date,
List<AppointmentType> appointmentTypes) {

List<ScheduledAppointmentBlock> scheduledAppointmentBlockList = new ArrayList<ScheduledAppointmentBlock>();

for (AppointmentBlock appointmentBlock : getAppointmentBlockList(location, date, appointmentTypes)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,24 +494,24 @@ public void shouldReturnDailyAppointmentsWithoutProviderAssigned() throws Except
List<Appointment> appointmentList = scheduledAppointmentBlockList.get(0).getAppointments();
assertEquals(1, appointmentList.size());
}

@Test
public void shouldReturnDailyAppointmentsWhenMultipleAppointmentTypesChosen() throws Exception {

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
Date date = format.parse("2014-01-02 00:00:00.0");

Location location = Context.getLocationService().getLocation(3);

AppointmentType appointmentType2 = service.getAppointmentType(3);
AppointmentType appointmentType3 = service.getAppointmentType(1);

List<ScheduledAppointmentBlock> scheduledAppointmentBlockList = service.getDailyAppointmentBlocks(location, date,
Arrays.asList(appointmentType2, appointmentType3));

assertEquals(1, scheduledAppointmentBlockList.size());
assertEquals(new Integer(5), scheduledAppointmentBlockList.get(0).getId());
}
@Test
public void shouldReturnDailyAppointmentsWhenMultipleAppointmentTypesChosen() throws Exception {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
Date date = format.parse("2014-01-02 00:00:00.0");
Location location = Context.getLocationService().getLocation(3);
AppointmentType appointmentType2 = service.getAppointmentType(3);
AppointmentType appointmentType3 = service.getAppointmentType(1);
List<ScheduledAppointmentBlock> scheduledAppointmentBlockList = service.getDailyAppointmentBlocks(location, date,
Arrays.asList(appointmentType2, appointmentType3));
assertEquals(1, scheduledAppointmentBlockList.size());
assertEquals(new Integer(5), scheduledAppointmentBlockList.get(0).getAppointmentBlock().getId());
}

@Test
@Verifies(value = "retrieve all appointments scheduled in a given time slot", method = "getAppointmentsInTimeSlot(TimeSlot)")
Expand Down

0 comments on commit 701b073

Please sign in to comment.