Advertisement
Guest User

Untitled

a guest
Dec 6th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. @Test
  2. @Verifies(value = "should get all correct appointment blocks", method = "getAppointmentBlocksByDateAndLocation(String,Integer)")
  3. public void getAppointmentBlocksByDateAndLocation_shouldGetAllCorrectAppointmentBlock() throws Exception {
  4. AppointmentBlock appointmentBlock = service.getAppointmentBlock(1);
  5. Location location = appointmentBlock.getLocation();
  6. Date fromDate = appointmentBlock.getStartDate();
  7. Date toDate = appointmentBlock.getEndDate();
  8. List<AppointmentBlock> appointmentBlocks = service.getAppointmentBlocks(fromDate,toDate, location);
  9. assertNotNull(appointmentBlocks);
  10. assertEquals(new Integer(1), appointmentBlocks.get(0).getAppointmentBlockId());
  11.  
  12. appointmentBlock = service.getAppointmentBlock(2);
  13. fromDate = appointmentBlock.getStartDate();
  14. toDate = appointmentBlock.getEndDate();
  15. appointmentBlocks = service.getAppointmentBlocks(fromDate,toDate, null);
  16. assertNotNull(appointmentBlocks);
  17. assertEquals(new Integer(2), appointmentBlocks.get(0).getAppointmentBlockId());
  18.  
  19.  
  20. appointmentBlocks = service.getAppointmentBlocks(null,null, location);
  21. assertNotNull(appointmentBlocks);
  22. assertEquals(2, appointmentBlocks.size());
  23.  
  24. appointmentBlocks = service.getAppointmentBlocks(null,null, null);
  25. assertEquals(3, appointmentBlocks.size());
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement