public void CannotVerifyStringWithDifferentHash() { var plainText = "beautiful"; var target = new BCryptHashService(_secureRandomGenerator, _encryptionService); var hashResult = target.GetHash(plainText); var actual = target.Verify("Not so good", hashResult.Hash, hashResult.Salt); Assert.IsFalse(actual); }
public void CanVerifyStringWithSameText() { var plainText = "beautiful"; var target = new BCryptHashService(_secureRandomGenerator, _encryptionService); var hashResult = target.GetHash(plainText); var actual = target.Verify(plainText, hashResult.Hash, hashResult.Salt); Assert.IsTrue(actual); }