Пример #1
0
        public void Get_all_doctors()
        {
            HospitalApp.Controllers.DoctorController controller = new HospitalApp.Controllers.DoctorController(this.SetupRepository(null, null).Object);

            var actionResult = controller.GetAll();

            ConvertToList(actionResult).ShouldBeEquivalentTo(CreateDoctors());
        }
Пример #2
0
        public void Add_doctor()
        {
            DoctorDto myDoctor = CreateDoctor();

            HospitalApp.Controllers.DoctorController controller = new HospitalApp.Controllers.DoctorController(this.SetupRepository(myDoctor, null).Object);

            var actionResult = controller.Add(myDoctor);

            ConvertToObject(actionResult).ShouldBeEquivalentTo(myDoctor);
        }
Пример #3
0
        public void Get_by_type()
        {
            List <DoctorDto> specialists = CreateDoctors().FindAll(doctor => doctor.Type == DoctorType.Specialist);

            HospitalApp.Controllers.DoctorController controller = new HospitalApp.Controllers.DoctorController(this.SetupRepository(null, specialists).Object);

            var actionResult = controller.GetByType(DoctorType.Specialist);

            ConvertToList(actionResult).ShouldBeEquivalentTo(specialists);
        }
Пример #4
0
        public void Get_by_id()
        {
            DoctorDto myDoctor = CreateDoctors().Find(d => d.Id == 1);

            HospitalApp.Controllers.DoctorController controller = new HospitalApp.Controllers.DoctorController(this.SetupRepository(myDoctor, null).Object);

            var actionResult = controller.GetById(myDoctor.Id);

            ConvertToObject(actionResult).ShouldBeEquivalentTo(myDoctor);
        }
Пример #5
0
        public void Get_general_practitioner()
        {
            PatientDto patient = CreatePatient();
            DoctorDto  doctor  = CreateDoctors().Find(d => d.Id == patient.GeneralPractitionerId);

            HospitalApp.Controllers.DoctorController controller = new HospitalApp.Controllers.DoctorController(this.SetupRepository(doctor, null).Object);

            var actionResult = controller.GetGeneralPractitioner(patient.Id);

            ConvertToObject(actionResult).ShouldBeEquivalentTo(doctor);
        }
Пример #6
0
        public void Get_specialist()
        {
            PatientDto  patient  = CreatePatient();
            ReferralDto referral = CreateReferral();
            DoctorDto   doctor   = CreateDoctors().Find(d => d.Id == referral.SpecialistId && patient.Id == referral.PatientId);

            HospitalApp.Controllers.DoctorController controller = new HospitalApp.Controllers.DoctorController(this.SetupRepository(doctor, null).Object);

            var actionResult = controller.GetSpecialist(patient.Id);

            ConvertToObject(actionResult).ShouldBeEquivalentTo(doctor);
        }