Ejemplo n.º 1
0
        public void ComputeHashCreatesHashOfSomeInputDataAndItIs256BitsInLength()
        {
            var data = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };

            ISecureHash hash       = new SecureHash();
            var         hashedData = hash.ComputeHash(data);

            Assert.AreEqual(32, hashedData.Length);
        }
Ejemplo n.º 2
0
        public void ComputeHashCreatesHashOfSomeInputDataAndItIsDifferentToInputData()
        {
            var data = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };

            ISecureHash hash       = new SecureHash();
            var         hashedData = hash.ComputeHash(data);

            Assert.IsTrue(ByteArrayCompare(data, hashedData));
        }
Ejemplo n.º 3
0
        public void ComputeHashCreatesHashOfSomeInputData()
        {
            var data = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };

            ISecureHash hash = new SecureHash();

            byte[] hashedData = hash.ComputeHash(data);

            Assert.IsNotNull(hashedData);
        }
Ejemplo n.º 4
0
        public void ComputeHashThrowsArgumentNullExceptionIfDataToHashedIsNull()
        {
            ISecureHash hash = new SecureHash();

            hash.ComputeHash(null);
        }