Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }