public void CheckPassword_UnsaltedPassword_False() { string password = "******"; IPasswordHasher subject = new SimplePasswordHasher("userName"); Assert.That(subject.CheckPassword(password, password), Is.False); }
public void CheckPassword_AnotherSaltedPassword_False() { string password = "******"; IPasswordHasher subject = new SimplePasswordHasher("userName"); string hashed = subject.HashPassword("anotherPassword"); Assert.That(subject.CheckPassword(password, hashed), Is.False); }
public void CheckPassword_SameSaltedPassword_True() { string password = "******"; IPasswordHasher subject = new SimplePasswordHasher("userName"); string hashed = subject.HashPassword(password); Assert.That(subject.CheckPassword(password, hashed), Is.True); }
public void CheckPassword_DifferentUserPassword_False() { string password = "******"; IPasswordHasher oneHasher = new SimplePasswordHasher("user1"), twoHasher = new SimplePasswordHasher("user2"); string hashedWithOne = oneHasher.HashPassword(password); Assert.That(twoHasher.CheckPassword(password, hashedWithOne), Is.False); }