public async Task OnPostEmailMfaAsync_GivenCommandFails_ExpectPrgErrorStateAndRedirectToSamePage()
        {
            var mediator = new Mock <IMediator>();

            mediator.Setup(x => x.Send(It.IsAny <EmailMfaRequestedCommand>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(ResultWithError.Fail(new ErrorData(ErrorCodes.AuthenticationFailed)));

            var currentAuthenticatedUserProvider = new Mock <ICurrentAuthenticatedUserProvider>();
            var page = new ValidateDeviceMfa(currentAuthenticatedUserProvider.Object, mediator.Object);

            Assert.IsType <RedirectToPageResult>(await page.OnPostEmailMfaAsync());
        }
        public async Task OnPostEmailMfaAsync_GivenCommandSucceeds_ExpectRedirectAppMfaPage()
        {
            var mediator = new Mock <IMediator>();

            mediator.Setup(x => x.Send(It.IsAny <EmailMfaRequestedCommand>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(ResultWithError.Ok <ErrorData>());

            var currentAuthenticatedUserProvider = new Mock <ICurrentAuthenticatedUserProvider>();
            var page = new ValidateDeviceMfa(currentAuthenticatedUserProvider.Object, mediator.Object);

            var result = Assert.IsType <RedirectToPageResult>(await page.OnPostEmailMfaAsync());

            Assert.Equal(PageLocations.AuthEmailMfa, result.PageName);
        }