public void BasicAppointmentSearchWithInvalidParameters() { FreeAppointmentSearchService freeAppointmentService = SetupRepositoriesAndServices(); Assert.Throws <BadRequestException>(() => freeAppointmentService.BasicSearch(new BasicAppointmentSearchDTO(patientCardId: 1, doctorJmbg: null, requiredEquipmentTypes: new List <int>(), earliestDateTime: new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 7, 0, 0), latestDateTime: new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 17, 0, 0)))); }
public void BasicUnavailableAppointmentSearch() { FreeAppointmentSearchService freeAppointmentService = SetupRepositoriesAndServices(); List <Examination> freeAppointments = (List <Examination>)freeAppointmentService.BasicSearch(new BasicAppointmentSearchDTO(patientCardId: 1, doctorJmbg: "0909965768767", requiredEquipmentTypes: new List <int>(), earliestDateTime: new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 7, 0, 0), latestDateTime: new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 7, 30, 0))); Assert.Empty(freeAppointments); }
public void Expected_appointment_with_unavailable_patient_priority_date_search() { FreeAppointmentSearchService freeAppointmentService = SetupRepositoriesAndServices(); List <Examination> freeAppointments = (List <Examination>)freeAppointmentService.SearchWithPriorities(new AppointmentSearchWithPrioritiesDTO { InitialParameters = new BasicAppointmentSearchDTO(patientCardId: 1, doctorJmbg: "1109965768767", requiredEquipmentTypes: new List <int>(), earliestDateTime: new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 7, 0, 0, DateTimeKind.Utc), latestDateTime: new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 9, 0, 0, DateTimeKind.Utc)), Priority = SearchPriority.Date, SpecialtyId = 1 }); Assert.Equal(0, freeAppointments.Count); }
public void Expected_no_appointment_for_emergency_without_shifting_appointments() { FreeAppointmentSearchService freeAppointmentService = SetupRepositoriesAndServices(); List <Examination> freeAppointmentsForEmergency = (List <Examination>)freeAppointmentService.GetUnchangedAppointmentsForEmergency( new AppointmentSearchWithPrioritiesDTO( new BasicAppointmentSearchDTO( patientCardId: 1, doctorJmbg: "0909965768767", requiredEquipmentTypes: new List <int>(), earliestDateTime: new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 7, 0, 0, DateTimeKind.Utc), latestDateTime: new DateTime()), SearchPriority.Date, 1)); Assert.Empty(freeAppointmentsForEmergency); }
public void Expect_shifted_appointment_for_emergancy() { FreeAppointmentSearchService freeAppointmentService = SetupRepositoriesAndServicesForUnshifted(); List <Examination> freeAppointmentsForEmergency = (List <Examination>)freeAppointmentService.GetShiftedAndSortedAppoinmentsForEmergency( new AppointmentSearchWithPrioritiesDTO( new BasicAppointmentSearchDTO( patientCardId: 3, doctorJmbg: "0909965768767", requiredEquipmentTypes: new List <int>(), earliestDateTime: new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 8, 23, 0, DateTimeKind.Utc), latestDateTime: new DateTime()), SearchPriority.Date, 1)); Assert.Equal(9, freeAppointmentsForEmergency.Count); Assert.True(freeAppointmentsForEmergency[0].DateAndTime.Equals(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 11, 0, 0, DateTimeKind.Utc))); Assert.True(freeAppointmentsForEmergency[5].DateAndTime.Equals(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 10, 30, 0, DateTimeKind.Utc))); }