public ActionResult HealthProfessional(string id, HealthProfessional healthProfessional) { var cmd = new AddHealthProfessional { FormId = id, HealthProfessional = healthProfessional, }; return(Exec(cmd, success: next => RedirectNext(next), failure: () => HealthProfessional_Render(id, healthProfessional))); }
public void Execute_StoresHealthProfessional() { var existingForm = new ChangeOfCircsBuilder("form123") .Insert(); existingForm.HealthProfessional.Should().BeNull("no data stored before executing command"); var cmd = new AddHealthProfessional { FormId = "form123", HealthProfessional = HealthProfessionalBuilder.NewValid(), }; cmd.Execute(); var updatedForm = Repository.Load <ChangeOfCircs>("form123"); updatedForm.HealthProfessional.Should().NotBeNull(); updatedForm.HealthProfessional.Pin.Should().Be(cmd.HealthProfessional.Pin); }
public void Execute_StoresHealthProfessionalDetails() { var existingForm = new BestStartGrantBuilder("form123") .With(f => f.ApplicantDetails, ApplicantDetailsBuilder.NewValid()) .With(f => f.ExpectedChildren, ExpectedChildrenBuilder.NewValid()) .With(f => f.ExistingChildren, ExistingChildrenBuilder.NewValid()) .Insert(); existingForm.HealthProfessional.Should().BeNull("no data stored before executing command"); var cmd = new AddHealthProfessional { FormId = "form123", HealthProfessional = HealthProfessionalBuilder.NewValid(), }; cmd.Execute(); var updatedForm = Repository.Load <BestStartGrant>("form123"); updatedForm.HealthProfessional.Should().NotBeNull(); updatedForm.HealthProfessional.Pin.Should().Be(cmd.HealthProfessional.Pin); }