Kanwar Singh
Kanwar Singh

Reputation: 908

The password retrieval answer provided is invalid

I'm trying to write a unit test for creating a new user . When i fill up the desired fields it gives me error "the password retrieval answer provided is invalid"

Here is my Form enter image description here

Here is my code

        public MembershipCreateStatus CreateUser(string userName, string password, string email)
        {
            MembershipCreateStatus status;
            _provider.CreateUser(userName, password, email, string.Empty, string.Empty, true, string.Empty, out status);
            return status;
        }

        public bool ChangePassword(string userName, string oldPassword, string newPassword)
        {
            MembershipUser currentUser = _provider.GetUser(userName, true /* userIsOnline */);
            return currentUser.ChangePassword(oldPassword, newPassword);
        }
    }

Upvotes: 1

Views: 207

Answers (1)

Sheenu Mehra
Sheenu Mehra

Reputation: 178

try to set all parameters in CreateUser() method.

Upvotes: 1

Related Questions