public void Get_all_patients() { HospitalApp.Controllers.PatientController controller = new HospitalApp.Controllers.PatientController(this.SetupRepository(null, null).Object); var actionResult = controller.GetAll(); ConvertToList(actionResult).ShouldBeEquivalentTo(CreatePatients()); }
public void Get_by_id() { PatientDto myPatient = CreatePatients().Find(p => p.Id == 1); HospitalApp.Controllers.PatientController controller = new HospitalApp.Controllers.PatientController(this.SetupRepository(myPatient, null).Object); var actionResult = controller.GetById(myPatient.Id); ConvertToObject(actionResult).ShouldBeEquivalentTo(myPatient); }
public void Add_patient() { PatientDto myPatient = CreatePatient(); Patient convertedPatient = PatientAdapter.PatientDtoToPatient(myPatient); HospitalApp.Controllers.PatientController controller = new HospitalApp.Controllers.PatientController(this.SetupRepository(myPatient, convertedPatient).Object); var actionResult = controller.Add(convertedPatient); ConvertToObject(actionResult).ShouldBeEquivalentTo(myPatient); }