public void Set_general_practitioner() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService doctorService = new HospitalApp.Services.DoctorService(context); HospitalApp.Services.PatientService service = new HospitalApp.Services.PatientService(context, doctorService); PatientDto patient = service.SetGeneralPractitioner(11, 21); Assert.Equal(21, patient.GeneralPractitionerId); } }
public void Get_patient_specialist() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService service = new HospitalApp.Services.DoctorService(context); DoctorDto mySpecialist = service.GetSpecialist(11); mySpecialist.Id.ShouldBe(22); } }
public void Get_all_patients() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService doctorService = new HospitalApp.Services.DoctorService(context); HospitalApp.Services.PatientService service = new HospitalApp.Services.PatientService(context, doctorService); List <PatientDto> patients = service.GetAll(); patients.Count.ShouldBeGreaterThanOrEqualTo(2); } }
public void Get_general_practitioner() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService service = new HospitalApp.Services.DoctorService(context); DoctorDto myGeneralPractitioner = service.GetGeneralPractitioner(11); myGeneralPractitioner.Id.ShouldBe(21); } }
public void Get_by_type() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService service = new HospitalApp.Services.DoctorService(context); List <DoctorDto> generalPractitioners = service.GetByType(DoctorType.GeneralPractitioner); generalPractitioners.ShouldNotBeNull(); } }
public void Get_by_id() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService service = new HospitalApp.Services.DoctorService(context); DoctorDto doctor = service.GetById(22); Assert.Equal(22, doctor.Id); } }
public void Get_all_doctors() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService service = new HospitalApp.Services.DoctorService(context); List <DoctorDto> doctors = service.GetAll(); doctors.Count.ShouldBeGreaterThanOrEqualTo(2); } }
public void Get_appointment_patient() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService doctorService = new HospitalApp.Services.DoctorService(context); HospitalApp.Services.PatientService service = new HospitalApp.Services.PatientService(context, doctorService); PatientDto myPatient = service.GetAppointmentPatient(1); myPatient.Id.ShouldBe(11); } }
public void Set_random_general_practitioner() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService doctorService = new HospitalApp.Services.DoctorService(context); HospitalApp.Services.PatientService service = new HospitalApp.Services.PatientService(context, doctorService); PatientDto patient = service.GetById(12); Patient k = PatientAdapter.PatientDtoToPatient(patient); service.GiveRandomGeneralPractitioner(k); Assert.NotNull(k.GeneralPractitionerId); } }
public void Add() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService service = new HospitalApp.Services.DoctorService(context); DoctorDto newDoctor = new DoctorDto { Id = 23, FirstName = "Doktor", LastName = "Doktorica", Username = "******", Type = DoctorType.Specialist }; DoctorDto doctor = service.Add(newDoctor); doctor.ShouldNotBeNull(); } }
public void Add() { using (var context = new MyDbContext(_options)) { SetupDatabase(context); HospitalApp.Services.DoctorService doctorService = new HospitalApp.Services.DoctorService(context); HospitalApp.Services.PatientService service = new HospitalApp.Services.PatientService(context, doctorService); Patient newPatient = new Patient { Id = 13, Password = "******", FirstName = "Miladin", LastName = "Simic", Username = "******" }; PatientDto patient = service.Add(newPatient); patient.ShouldNotBeNull(); } }