public void EncryptPasswordTwiceAndCompareTest_EncryptsAPasswordTwiceAndThenComparesBothToBeTheSame_FailsIfNotEqual() { PasswordEncryptionService passwordEncryption = new PasswordEncryptionService(); string password = "******"; string hasedPassword = passwordEncryption.EncryptPassword(password); Assert.IsNotNull(hasedPassword); string samePassword = "******"; Assert.IsTrue(passwordEncryption.VerifyPassword(samePassword, hasedPassword)); }
public void CompareFalseEncrytionTest_EncryptsAPasswordTwiceAndThenComparesBothToBeDifferentByVerifyMethod_FailsIfTheyAreEqual() { PasswordEncryptionService passwordEncryption = new PasswordEncryptionService(); string password = "******"; string hashedPassword = passwordEncryption.EncryptPassword(password); Assert.IsNotNull(hashedPassword); // Last letter is different string secondPassword = "******"; Assert.IsFalse(passwordEncryption.VerifyPassword(secondPassword, hashedPassword)); }