public void Should_Macth_Valid_Password() { string valid_password = "******"; string salt = string.Empty; var user = new User(); user.Password = CryptographyHelper.EncryptPassword(valid_password, out salt); user.Salt = salt; var match = user.VerifyPasswordMatch(valid_password); Assert.IsTrue(match); }
public void Should_Not_Macth_Wrong_Password() { string not_valid_password = "******"; string valid_password = "******"; string salt = string.Empty; var user = new User(); user.Password = CryptographyHelper.EncryptPassword(valid_password, out salt); user.Salt = salt; var match = user.VerifyPasswordMatch(not_valid_password); Assert.IsFalse(match); }