Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
        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);
            }
        }
Example #5
0
        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();
            }
        }