public void Password_Fail() { string password = "******"; PurplePassword PurplePasswordInstance = new PurplePassword (); string passwordHash = PurplePasswordInstance.CreateHash (password); Assert.IsFalse(PurplePasswordInstance.ValidatePassword ("WrongPassword987?", passwordHash)); }
private static bool create_database_user(PurpleAccount user, string password) { PurplePassword PuPa = new PurplePassword (); user.password = PuPa.CreateHash(password); user.NewGuid(); user.account_created = DateTime.Now; user.account_type = "User"; user.active = false; if(PurpleAttributes.Validator.Validate (user, out errorList)) { int result = user.ToSQLInsert ().Execute (); if(result == 1) PurpleMailGenerator.SendMail(PurpleConfig.Mail.Template.Register, user); return (result==1) ? true : false; } return false; }
public void Password() { string password = "******"; PurplePassword PurplePasswordInstance = new PurplePassword (); string passwordHash = PurplePasswordInstance.CreateHash (password); Assert.IsTrue(PurplePasswordInstance.ValidatePassword (password, passwordHash)); }