예제 #1
0
 public void SetUp()
 {
     IClinic testClinic = new Clinic();
     IDoctor testDoctor = new Dentist();
     IPatient testPatient = new Patient();
     testClinic.AddDoctor(testDoctor);
     testClinic.AddPatient(testPatient);
 }
예제 #2
0
        public void PayBillTest()
        {
            // arrange
            IPatient testPatient = new Patient();
            // act
            testPatient.PatientBill = new Bill();
            testPatient.PayBill();

            // assert
            Assert.IsTrue(testPatient.PatientBill.IsPayed);
        }
예제 #3
0
        public void DoctorShouldReturnRightDiagnosis()
        {
            // arrange
            IDoctor testDoctor = new Orthopedist();
            IPatient testPatient = new Patient();
            testPatient.PatientComplaint.Symptoms.Add(Symptom.Headache);

            // act
            Diagnosis returnedDiagnosis = testDoctor.Diagnosticate(testPatient.PatientComplaint);

            // assert
            Assert.AreSame(new Diagnosis() , returnedDiagnosis);
        }
예제 #4
0
        public void ClinicShouldGiveRightDoctor()
        {
            // arrange
            IClinic testClinic = new Clinic();
            IPatient testPatient = new Patient();
            testPatient.PatientComplaint.Symptoms.Add(Symptom.Headache);

            // act
            IDoctor returnedDoctor = testClinic.GiveDoctor(testPatient);

            // assert
            Assert.IsTrue(returnedDoctor is Orthopedist);
        }
예제 #5
0
        public void ClinicShouldGiveBillForTreatment()
        {
            // arrange
            IClinic testClinic = new Clinic();
            IPatient testPatient = new Patient();
            testPatient.PatientComplaint.Symptoms.Add(Symptom.Headache);
            IDoctor testDoctor = testClinic.GiveDoctor(testPatient);
            Treatment testTreatment = testDoctor.PrescribeTreatment(testDoctor.Diagnosticate(testPatient.PatientComplaint));

            // act
            Bill returnedBill = testClinic.GiveBill(testTreatment);

            // assert
            Assert.IsNotNull(returnedBill);
        }
예제 #6
0
        public void UseCaseTest()
        {
            // arrange

            IClinic testClinic = new Clinic();
            IDoctor testDoctor = new Dentist();
            IPatient testPatient = new Patient();
            IInsuranceCompany testInsuranceCompany = new InsuranceCompany();
            testInsuranceCompany.Clients.Add(testPatient.Insurance);
            testClinic.AddDoctor(testDoctor);

            // act

            //Пациент приходит в больницу с жалобой
            testPatient.PatientComplaint.Symptoms.Add(Symptom.Headache);
            testClinic.AddPatient(testPatient);

            //Его направляют к нужному врачу(лор, ортопед, стоматолог).
            IDoctor doctorForPatient = testClinic.GiveDoctor(testClinic.Patients.LastOrDefault());

            //Доктор ставит диагноз и выписывает назначение.
            Diagnosis diagnosisForPatient = doctorForPatient.Diagnosticate(testPatient.PatientComplaint);
            Treatment appointmentForPatient = doctorForPatient.PrescribeTreatment(diagnosisForPatient);

            //Больница выставляет счет страховой компании пациента.
            Bill billForPatient = testClinic.GiveBill(appointmentForPatient);

            //Страховая компания оплачивает счет.
            testPatient.PayBill();

            //После оплаты больница начинает лечение.
            testClinic.Cure(testPatient, diagnosisForPatient, appointmentForPatient);

            // assert
            Assert.IsNull(testPatient.PatientComplaint.Symptoms);
        }