public void TestCompareMatchesWithPasswordAsDavidButCaseChanged() { IPassword userInputPassword = new MD5HashedPassword("David"); IPassword databasePassword = new MD5HashedPassword("david"); Assert.IsFalse(userInputPassword.MatchesHash(databasePassword.GenerateHash())); }
public void TestCompareMatchesWithPasswordAsPassword() { IPassword userInputPassword = new MD5HashedPassword("password"); IPassword databasePassword = new MD5HashedPassword("password"); Assert.IsTrue(userInputPassword.MatchesHash(databasePassword.GenerateHash())); }
public void DavidKeenDoesNotHaveAHashedPasswordOfPassword() { IDatabaseContext testDatabase = new TestDatabase(); IPassword userInputPassword = new MD5HashedPassword("david"); IUser david = testDatabase.GetUser("David", "Keen"); Assert.IsFalse(userInputPassword.MatchesHash(david.GetPasswordHash())); }