Exemplo n.º 1
0
        public void TestIsPasswordCorrectForTrue()
        {
            CryptoHelper crypto = new CryptoHelper();
            string pw = "The Sun Did Not Shine";
            string pwAsUserEnteredString = "The Sun Did Not Shine";

            byte[] pwAsByteArrayFromDB = crypto.CreateHashSha512(pw);

            bool pwcorrect = crypto.IsPasswordCorrect(pwAsUserEnteredString, pwAsByteArrayFromDB);

            Assert.IsTrue(pwcorrect);
        }
Exemplo n.º 2
0
        public void TestIsPasswordCorrectForFalse()
        {
            CryptoHelper crypto = new CryptoHelper();
            string pw = "The Sun Did Not Shine";
            string pwAsUserEnteredString = "It Was Too Wet To Play";
            //string pwAsUserEnteredString = "the sun did not shine";

            byte[] pwAsByteArrayFromDB = crypto.CreateHashSha512(pw);

            bool pwcorrect = crypto.IsPasswordCorrect(pwAsUserEnteredString, pwAsByteArrayFromDB);

            Assert.IsFalse(pwcorrect);
        }