Example #1
0
        public void EditGET_GivenPatient_PatientBuilderShouldBeCalled()
        {
            var patient = new Patient();
            var genders = new Genders();

            A.CallTo(() => _queryDispatcher.Dispatch <PatientByIdQuery, Patient>(A <PatientByIdQuery> ._)).Returns(patient);
            A.CallTo(() => _queryDispatcher.Dispatch <GenderListQuery, Genders>(A <GenderListQuery> ._)).Returns(genders);

            _personController.Edit(A <Guid> ._);

            A.CallTo(() => _patientBuilder.BuildEditPatientViewModel(patient, genders)).MustHaveHappened(Repeated.Exactly.Once);
        }
Example #2
0
        public virtual ActionResult Edit(Guid id)
        {
            var patientQuery = new PatientByIdQuery {
                PatientId = id
            };

            var patient = _queryDispatcher.Dispatch <PatientByIdQuery, Patient>(patientQuery);

            var genders = _queryDispatcher.Dispatch <GenderListQuery, Genders>(new GenderListQuery());

            var model = _patientViewModelBuilder.BuildEditPatientViewModel(patient, genders);

            return(View(model));
        }