CustomMembershipProvider.ValidateUser C# (CSharp) Method

ValidateUser() public method

public ValidateUser ( string username, string password ) : bool
username string
password string
return bool
		public override bool ValidateUser(string username, string password) {
            // do stuff with username, password and this.ValidationType
		}

Same methods

CustomMembershipProvider::ValidateUser ( string username, string password, LoginValidationType validationType = LoginValidationType.WebsiteSpecific ) : bool

Usage Example

コード例 #1
0
        public void When_ValidateUser_is_called_with_a_valid_UserName_and_a_valid_Password_then_true_is_returned()
        {
            const string decryptedPassword = "******";
            var          user = UserCreator.CreateSingle();

            UserProcess
            .Expect(process =>
                    process.GetUserByLoginName(user.Login.LoginName))
            .Return(user)
            .Repeat.Once();
            UserProcess.Replay();

            CryptographyProcess
            .Expect(process => process.Decrypt(user.Login.Password))
            .Return(decryptedPassword)
            .Repeat.Once();
            CryptographyProcess.Replay();

            var result = CustomMembershipProvider.ValidateUser(user.Login.LoginName, decryptedPassword);

            UserProcess.VerifyAllExpectations();
            CryptographyProcess.VerifyAllExpectations();

            Assert.IsTrue(result);
        }
All Usage Examples Of CustomMembershipProvider::ValidateUser
CustomMembershipProvider