public async Task ThenTheUnlockLockUserViewModelOrchestratorResponseIsReturned() { //Arrange _mediator.Setup(x => x.SendAsync(It.IsAny <ResendUnlockCodeCommand>())).ThrowsAsync(new InvalidRequestException(new Dictionary <string, string> { { "Email", "Some Error" } })); var model = new UnlockUserViewModel(); //Act var actual = await _accountOrchestrator.ResendUnlockCode(model); //Assert Assert.IsNotNull(actual); Assert.IsAssignableFrom <OrchestratorResponse <UnlockUserViewModel> >(actual); Assert.IsFalse(actual.Data.UnlockCodeSent); }
public async Task <ActionResult> RequestUnlockCode(UnlockUserViewModel unlockUserViewModel) { if (string.IsNullOrWhiteSpace(unlockUserViewModel.ReturnUrl)) { unlockUserViewModel.ReturnUrl = _owinWrapper.GetIdsReturnUrl(); } var result = await _accountOrchestrator.ResendUnlockCode(unlockUserViewModel); return(View("Unlock", result)); }