public async Task <ActionResult> RenameAccount(RenameEmployerAccountViewModel vm)
        {
            var userIdClaim = OwinWrapper.GetClaimValue(ControllerConstants.UserRefClaimKeyName);
            var response    = await _employerAccountOrchestrator.RenameEmployerAccount(vm, userIdClaim);

            if (response.Status == HttpStatusCode.OK)
            {
                var flashmessage = new FlashMessageViewModel
                {
                    Headline = "Account renamed",
                    Message  = "You successfully updated the account name",
                    Severity = FlashMessageSeverityLevel.Success
                };

                AddFlashMessageToCookie(flashmessage);

                return(RedirectToAction(ControllerConstants.IndexActionName, ControllerConstants.EmployerTeamControllerName));
            }

            var errorResponse = new OrchestratorResponse <RenameEmployerAccountViewModel>();

            if (response.Status == HttpStatusCode.BadRequest)
            {
                vm.ErrorDictionary = response.FlashMessage.ErrorMessages;
            }

            errorResponse.Data         = vm;
            errorResponse.FlashMessage = response.FlashMessage;
            errorResponse.Status       = response.Status;

            return(View(errorResponse));
        }
        public async Task ThenTheAccountNameShouldBeUpdated()
        {
            //Act
            var response = await _orchestrator.RenameEmployerAccount(new RenameEmployerAccountViewModel
            {
                NewName = "New Account Name"
            }, "ABC123");

            //Assert
            Assert.IsInstanceOf <OrchestratorResponse <RenameEmployerAccountViewModel> >(response);

            _mediator.Verify(x =>
                             x.SendAsync(It.Is <RenameEmployerAccountCommand>(c => c.NewName == "New Account Name")),
                             Times.Once());
        }