Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- @Verifies(value = "should get all the appointment blocks that correspounds to a given locaiton and between a given date interval", method = "getAppointmentBlocksByDateAndLocation(String,Integer)")
- public void getAppointmentBlocksByDateAndLocation_shouldGetAllCorrectAppointmentBlock() throws Exception {
- AppointmentBlock appointmentBlock = service.getAppointmentBlock(1);
- Location location = appointmentBlock.getLocation();
- Date fromDate = appointmentBlock.getStartDate();
- Date toDate = appointmentBlock.getEndDate();
- List<AppointmentBlock> appointmentBlocks = service.getAppointmentBlocks(fromDate,toDate, location);
- assertNotNull(appointmentBlocks);
- assertEquals(new Integer(1), appointmentBlocks.get(0).getAppointmentBlockId());
- appointmentBlock = service.getAppointmentBlock(2);
- fromDate = appointmentBlock.getStartDate();
- toDate = appointmentBlock.getEndDate();
- appointmentBlocks = service.getAppointmentBlocks(fromDate,toDate, null);
- assertNotNull(appointmentBlocks);
- assertEquals(new Integer(2), appointmentBlocks.get(0).getAppointmentBlockId());
- appointmentBlocks = service.getAppointmentBlocks(null,null, location);
- assertNotNull(appointmentBlocks);
- assertEquals(2, appointmentBlocks.size());
- appointmentBlocks = service.getAppointmentBlocks(null,null, null);
- assertEquals(3, appointmentBlocks.size());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement