public void MembershipProvider_EncodePassword_Hashed() { var provider = new MembershipProviderMock(); var settings = new NameValueCollection(); var name = "TestMembershipProvider"; settings.Add("applicationName", "TestApplication"); settings.Add("passwordFormat", "Hashed"); provider.Initialize(name, settings); var password = "******"; string salt = null; string hashedPassword1 = provider.EncodePassword(password, ref salt); string hashedPassword2 = provider.EncodePassword(password, ref salt); Assert.AreEqual(hashedPassword1, hashedPassword2); }
public void MembershipProvider_EncodePassword_Clear() { var provider = new MembershipProviderMock(); var settings = new NameValueCollection(); var name = "TestMembershipProvider"; settings.Add("applicationName", "TestApplication"); settings.Add("passwordFormat", "Clear"); provider.Initialize(name, settings); var password = "******"; string salt = null; string encodedPassword = provider.EncodePassword(password, ref salt); string decodedPassword = provider.DecodePassword(encodedPassword); Assert.AreEqual(password, decodedPassword); }