public void testGetPatientPresenter()
        {
            PatientPresenter patientPresenter = presenterFactory.getPatientPresenter(
                presenterFactory, new RepositoryFactory());

            Assert.IsNotNull(patientPresenter);
        }
Пример #2
0
        private void barButtonPatients_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PatientSearchForm patientSearchForm = new PatientSearchForm();

            patientSearchForm.MdiParent = this;
            PatientPresenter patientPresenter = new PatientPresenter(patientSearchForm, new PatientModel(), new GenderModel());

            patientSearchForm.Show();
        }
Пример #3
0
 private void patientEntryToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!FormBuilder.IsFormUnique(this, FormEnum.Patient))
     {
         var patient          = new Patient();
         var PatientPresenter = new PatientPresenter(patient);
         patient.MdiParent = this;
         patient.Show();
     }
 }
Пример #4
0
        private void btnAddPatient_Click(object sender, System.EventArgs e)
        {
            ProgressiveBar();

            Genere();
            var presenter = new PatientPresenter(this);

            presenter.SavePatient();
            ClearTextbox(this);

            new PatientPresenter(this, new PatientRepository());
        }
        public void registerPatientPositiveCase()
        {
            Mock <IQuestionView> questionview = new Mock <IQuestionView>();
            Mock <IPatientView>  view         = new Mock <IPatientView>();

            IPresenterFactory  presenterFactory  = new PresenterFactory();
            IRepositoryFactory repositoryFactory = new RepositoryFactory();

            PatientPresenter patientpresenter = new PatientPresenter(
                presenterFactory, repositoryFactory);

            patientpresenter.view             = view.Object;
            patientpresenter.view.city        = "newcastle";
            patientpresenter.view.country     = "UK";
            patientpresenter.view.postcode    = "ne48as";
            patientpresenter.view.email       = "*****@*****.**";
            patientpresenter.view.name        = "priyanka";
            patientpresenter.view.phoneNumber = "1234567890";
            patientpresenter.view.dob         = DateTime.Now;
            patientpresenter.RegisterPatient(questionview.Object);
            //patientpresenter.validate();
        }
        public void testRegisterPatient()
        {
            Mock <IRepositoryFactory> repositoryFactory = new Mock <IRepositoryFactory>();
            Mock <IPresenterFactory>  presenterFactory  = new Mock <IPresenterFactory>();

            PatientPresenter patientPresenter = new PatientPresenter(
                presenterFactory.Object, repositoryFactory.Object);

            Mock <IPatientView> patientView = new Mock <IPatientView>();

            // mock
            presenterFactory.Setup(x => x.getPatientPresenter(presenterFactory.Object, repositoryFactory.Object))
            .Returns(patientPresenter);

            RadiantDentalPracticePresenter radiantDentalPracticePresenter =
                new RadiantDentalPracticePresenter(presenterFactory.Object, repositoryFactory.Object);

            radiantDentalPracticePresenter.registerPatient(patientView.Object);

            // Bookupcheck
            Mock <ICheckupView> checkupView = new Mock <ICheckupView>();



            presenterFactory.Setup(x => x.getCheckUpPresenter(checkupView.Object,
                                                              (IAppointmentRepository)repositoryFactory.Object.getRepository("APPOINTMENT")));



            radiantDentalPracticePresenter.bookCheckup(checkupView.Object);



            //bookemergency



            Mock <IEmergencyView> emergencyView = new Mock <IEmergencyView>();



            presenterFactory.Setup(x => x.getEmergencyPresenter(emergencyView.Object,
                                                                (IAppointmentRepository)repositoryFactory.Object.getRepository("APPOINTMENT")));



            radiantDentalPracticePresenter.bookEmergency(emergencyView.Object);



            //recordtreatment



            Mock <IRecordTreatmentForm> recordTreatmentForm = new Mock <IRecordTreatmentForm>();



            RecordTreatmentPresenter recordTreatmentPresenter = new RecordTreatmentPresenter(presenterFactory.Object,
                                                                                             (ITreatmentPlanRepository)repositoryFactory.Object.getRepository("TREATMENTPLAN"));

            presenterFactory.Setup(x => x.getRecordTreatmentPresenter(presenterFactory.Object,
                                                                      (ITreatmentPlanRepository)repositoryFactory.Object.getRepository("TREATMENTPLAN"))).Returns(recordTreatmentPresenter);



            radiantDentalPracticePresenter.recordTreatmentPlan(recordTreatmentForm.Object);



            //OnDentalSurgeryVisit
            Mock <IDentalSurgeryVisitView> dentalSurgeryVisitView      = new Mock <IDentalSurgeryVisitView>();
            DentalSurgeryVisitPresenter    dentalSurgeryVisitPresenter = new DentalSurgeryVisitPresenter(repositoryFactory.Object, presenterFactory.Object);

            presenterFactory.Setup(x => x.getDentalSurgeryVisitPresenter(repositoryFactory.Object, presenterFactory.Object)).Returns(dentalSurgeryVisitPresenter);
            radiantDentalPracticePresenter.OnDentalSurgeryVisit(dentalSurgeryVisitView.Object);
        }
Пример #7
0
 public FormPatient()
 {
     InitializeComponent();
     presenter = new PatientPresenter(this);
 }