Beispiel #1
0
        public void UpdatePassword_VariousPasswordHashMethods_PasswordCanBeVerified(string hashMethod, string password)
        {
            SettingsKeyInfoProvider.SetValue("CMSPasswordFormat", 0, hashMethod);

            var user         = new User(mMembershipFakeFactory.UserWithPassword);
            var result       = manager.CallProtectedUpdatePassword(user, password);
            var passwordHash = UserInfoProvider.GetUserInfo(user.Id).GetValue("UserPassword");

            CMSAssert.All(() => Assert.AreEqual(UserInfoProvider.GetPasswordHash(password, hashMethod, user.GUID.ToString()), passwordHash),
                          () => Assert.IsTrue(manager.CallProtectedVerifyPassword(user, password)));
        }
Beispiel #2
0
        public void VerifyPassword_UserWithPassword_ExpectedResults(string password, bool expectedResult)
        {
            var user = new User(mMembershipFakeFactory.UserWithPassword);

            Assert.AreEqual(expectedResult, manager.CallProtectedVerifyPassword(user, password));
        }