public async Task ThenItShouldReturnAnInstanceOfChangeEmailViewModel()
        {
            // Act
            var actual = await _orchestrator.RequestChangeEmail(_model);

            // Assert
            Assert.IsNotNull(actual);
        }
Exemple #2
0
        public async Task <ActionResult> ChangeEmail(ChangeEmailViewModel model, string clientId, string returnUrl)
        {
            model.UserId    = GetLoggedInUserId();
            model.ClientId  = clientId;
            model.ReturnUrl = returnUrl;

            var response = await _accountOrchestrator.RequestChangeEmail(model);

            if (response.Status == HttpStatusCode.BadRequest)
            {
                response.Status = HttpStatusCode.OK;

                return(View("ChangeEmail", response));
            }
            TempData["EmailChangeRequested"] = true;
            TempData["EmailChangeNewEmail"]  = model.NewEmailAddress;

            TempData["EmailChangeReturnUrl"] = returnUrl;
            TempData["EmailChangeClientId"]  = clientId;

            return(RedirectToAction("ConfirmChangeEmail"));
        }