Пример #1
0
        public void ClearTextPasswordMatchesStoredWhenHashed()
        {
            string testPassword = "******";

            if (!PasswordUtility.CompareStoredPassword(testPassword, PasswordUtility.EncryptyPassword(testPassword)))
            {
                Assert.Fail();
            }
        }
Пример #2
0
        public void WrongPasswordThrowsException()
        {
            string testPassword  = "******";
            string wrongPassword = "******";

            Assert.ThrowsException <UnauthorizedAccessException>(() => { PasswordUtility.CompareStoredPassword(testPassword, PasswordUtility.EncryptyPassword(wrongPassword)); });
        }