Esempio n. 1
0
        public void ValidationError()
        {
            var viewModel = new AccountUnlockViewModel();
            var mediator  = new LoginMediatorBuilder().Build();
            var response  = mediator.Resend(viewModel);

            response.AssertValidationResult(LoginMediatorCodes.Resend.ValidationError);
        }
Esempio n. 2
0
        public void Error()
        {
            var viewModel = new AccountUnlockViewModel {
                EmailAddress = "*****@*****.**", ViewModelMessage = "Error", Status = AccountUnlockState.Error
            };
            var candidateServiceProvider = new Mock <ICandidateServiceProvider>();

            candidateServiceProvider.Setup(x => x.RequestAccountUnlockCode(It.IsAny <AccountUnlockViewModel>())).Returns(viewModel);
            var userDataProvider = new Mock <IUserDataProvider>();

            userDataProvider.Setup(x => x.Push(It.IsAny <string>(), It.IsAny <string>()));
            var mediator = new LoginMediatorBuilder().With(candidateServiceProvider).With(userDataProvider).Build();

            var response = mediator.Resend(viewModel);

            response.AssertMessage(LoginMediatorCodes.Resend.ResendFailed, AccountUnlockPageMessages.AccountUnlockResendCodeFailed, UserMessageLevel.Warning, true);
        }
Esempio n. 3
0
        public void AccountEmailAddressOrUnlockCodeInvalid()
        {
            var viewModel = new AccountUnlockViewModel {
                EmailAddress = "*****@*****.**", ViewModelMessage = "Unknown [email protected]", Status = AccountUnlockState.AccountEmailAddressOrUnlockCodeInvalid
            };
            var candidateServiceProvider = new Mock <ICandidateServiceProvider>();

            candidateServiceProvider.Setup(x => x.RequestAccountUnlockCode(It.IsAny <AccountUnlockViewModel>())).Returns(viewModel);
            var userDataProvider = new Mock <IUserDataProvider>();

            userDataProvider.Setup(x => x.Push(It.IsAny <string>(), It.IsAny <string>()));
            var mediator = new LoginMediatorBuilder().With(candidateServiceProvider).With(userDataProvider).Build();

            var response = mediator.Resend(viewModel);

            response.AssertMessage(LoginMediatorCodes.Resend.ResentSuccessfully, AccountUnlockPageMessages.AccountUnlockCodeMayHaveBeenResent, UserMessageLevel.Success, true);
        }