コード例 #1
0
        public ActionResult Identity(string id, IdentityModel model)
        {
            //Retrieve the formid (session identifier) that we saved prior to leaving BSG and entering GOV.UKVerify site
            if (Request.Cookies["formId"] != null && id == null)
            {
                System.Web.HttpCookie aCookie = Request.Cookies["formId"];
                id = aCookie.Value;
            }

            var cmd = new AddIdentity
            {
                FormId   = id,
                Identity = model.Email,
            };

            return(Exec(cmd,
                        success: next => RedirectNext(next),
                        failure: () => Identity_Render(id, model.Email)));
        }
コード例 #2
0
        public void Execute_StoresConsent()
        {
            new BestStartGrantBuilder("form").PreviousApplicationFor("*****@*****.**").Insert();

            var existingForm = new ChangeOfCircsBuilder("form123")
                               .Insert();

            existingForm.UserId.Should().BeNull("no data stored before executing command");

            var cmd = new AddIdentity
            {
                FormId   = "form123",
                Identity = "*****@*****.**",
            };

            cmd.Execute();

            var updatedForm = Repository.Load <ChangeOfCircs>("form123");

            updatedForm.UserId.Should().NotBeNull();
            updatedForm.UserId.Should().Be(cmd.Identity);
        }