Example #1
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);
        }
Example #2
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);
        }