Ejemplo n.º 1
0
        public void ComputeAndVerifyHash_String()
        {
            var verifyResult = new GenericHashResult();
            var errorMessage = "";

            var hashResult = _sha384.ComputeHash(_testString);

            if (hashResult.Success)
            {
                verifyResult = _sha384.VerifyHash(hashResult.HashString, _testString);

                if (!verifyResult.Success)
                {
                    errorMessage = verifyResult.Message;
                }
            }
            else
            {
                errorMessage = hashResult.Message;
            }

            Assert.IsTrue((hashResult.Success && verifyResult.Success), errorMessage);
        }