Пример #1
0
        public void CantResetPasswordTwiceUsingSameSecret()
        {
            SignUpConfirmationNotifier.Reset();
            Service.SignUp("[email protected]", "qwerty123").Ok();
            Service.ConfirmSignUpRequest(SignUpConfirmationNotifier.LastSecret).Ok();

            ResetPasswordNotifier.Reset();
            Service.RequestPasswordReset("[email protected]").Ok();
            Service.ResetPassword(ResetPasswordNotifier.LastSecret, "qwerty").Ok();
            Service.ResetPassword(ResetPasswordNotifier.LastSecret, "qwerty1").Error(ServiceError.NoSuchPendingPasswordResetRequest);
        }
Пример #2
0
        public void CanResetPasswordWithValidSecret()
        {
            SignUpConfirmationNotifier.Reset();
            Service.SignUp("[email protected]", "qwerty123").Ok();
            Service.ConfirmSignUpRequest(SignUpConfirmationNotifier.LastSecret).Ok();

            ResetPasswordNotifier.Reset();
            Service.RequestPasswordReset("[email protected]").Ok();
            Service.ResetPassword(ResetPasswordNotifier.LastSecret, "qwerty").Ok();

            Service.SignIn("[email protected]", "qwerty").Ok();
            Service.SignIn("[email protected]", "qwerty123").Error(ServiceError.InvalidPassword);
        }