Esempio n. 1
0
        public override bool Equals(Object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            HashBlock p = (HashBlock)obj;

            return((this.Algorithm == p.Algorithm) && (this.Value == p.Value));
        }
Esempio n. 2
0
        public static void HashBlock_InvalidEnum_Test()
        {
            string md5Hash = "f59b7efafd800e27b47a488d30615c73";

            byte[] utf8Hash = System.Text.Encoding.UTF8.GetBytes(md5Hash);
            byte[] test     = { 5 };
            test = test.Concat(utf8Hash).ToArray();

            HashBlock hashBlock = new HashBlock(test);

            Assert.AreEqual(hashBlock.Algorithm, HashBlock.HashAlgorithm.Invalid);
        }