public ActionResult Consent(string id, Consent consent) { var cmd = new AddConsent { FormId = id, Consent = consent, }; return(Exec(cmd, success: next => RedirectNext(next), failure: () => Consent_Render(id, consent))); }
public void Execute_StoresConsent() { var existingForm = new ChangeOfCircsBuilder("form123") .Insert(); existingForm.Consent.Should().BeNull("no data stored before executing command"); var cmd = new AddConsent { FormId = "form123", Consent = ConsentBuilder.NewValid(), }; cmd.Execute(); var updatedForm = Repository.Load <ChangeOfCircs>("form123"); updatedForm.Consent.Should().NotBeNull(); updatedForm.Consent.AgreedToConsent.Should().Be(cmd.Consent.AgreedToConsent); }