public void Set_appointment_done() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.ReferralService referralService = new HospitalApp.Services.ReferralService(context); HospitalApp.Services.AppointmentService service = new HospitalApp.Services.AppointmentService(context, referralService); AppointmentDto appointment = service.SetAppointmentDone(1); appointment.Status.ShouldBe(AppointmentStatus.Done); } }
public void Get_by_id() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.ReferralService referralService = new HospitalApp.Services.ReferralService(context); HospitalApp.Services.AppointmentService service = new HospitalApp.Services.AppointmentService(context, referralService); AppointmentDto appointment = service.GetById(1); appointment.Id.ShouldBe(1); } }
public void Get_all_appointments() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.ReferralService referralService = new HospitalApp.Services.ReferralService(context); HospitalApp.Services.AppointmentService service = new HospitalApp.Services.AppointmentService(context, referralService); List <AppointmentDto> appointments = service.GetAll(); appointments.Count.ShouldBeGreaterThanOrEqualTo(2); } }
public void Get_appointment_full_date_string() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.ReferralService referralService = new HospitalApp.Services.ReferralService(context); HospitalApp.Services.AppointmentService service = new HospitalApp.Services.AppointmentService(context, referralService); Appointment app = CreateOne(context); DateTime dateAndTime = service.GetAppointmentFullDate(app); dateAndTime.ShouldBe(DateTime.Parse("2020-05-05 02 PM")); } }
public void Finish_appointment() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.ReferralService referralService = new HospitalApp.Services.ReferralService(context); HospitalApp.Services.AppointmentService service = new HospitalApp.Services.AppointmentService(context, referralService); Appointment app = CreateOne(context); AppointmentDto appDto = service.FinishAppointment(app.Id); appDto.Status.ShouldBe(AppointmentStatus.Done); } }
public void Set_appointments_referral_deleted() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.ReferralService referralService = new HospitalApp.Services.ReferralService(context); HospitalApp.Services.AppointmentService service = new HospitalApp.Services.AppointmentService(context, referralService); Appointment app = CreateOne(context); service.SetAppointmentsReferralDeleted(app); app.Patient.Referral.IsDeleted.ShouldBe(true); } }
public void Get_patient_appointments() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.ReferralService referralService = new HospitalApp.Services.ReferralService(context); HospitalApp.Services.AppointmentService service = new HospitalApp.Services.AppointmentService(context, referralService); Patient p = CreatePatient(context); List <AppointmentDto> apps = service.GetPatientAppointments(p.Id); p.Appointments.Count.ShouldBe(apps.Count); } }
public void Get_doctor_appointments() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.ReferralService referralService = new HospitalApp.Services.ReferralService(context); HospitalApp.Services.AppointmentService service = new HospitalApp.Services.AppointmentService(context, referralService); Doctor d = CreateDoctor(context); List <AppointmentDto> apps = service.GetDoctorAppointments(d.Id); apps.Count.ShouldBe(2); } }