public void HashBytes_WhenHashAlgorithmNull_Throws()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => SignedPackageArchiveIOUtility.HashBytes(
                    hashAlgorithm: null, bytes: new byte[] { 0 }));

            Assert.Equal("hashAlgorithm", exception.ParamName);
        }
        public void HashBytes_WhenBytesNullOrEmpty_Throws(byte[] bytes)
        {
            using (var hashAlgorithm = SHA256.Create())
            {
                var exception = Assert.Throws <ArgumentException>(
                    () => SignedPackageArchiveIOUtility.HashBytes(
                        hashAlgorithm,
                        bytes));

                Assert.Equal("bytes", exception.ParamName);
            }
        }
        public void HashBytes_WithInputBytes_Hashes()
        {
            using (var hashAlgorithm = SHA256.Create())
            {
                SignedPackageArchiveIOUtility.HashBytes(hashAlgorithm, new byte[] { 0, 1, 2 });

                hashAlgorithm.TransformFinalBlock(new byte[0], inputOffset: 0, inputCount: 0);

                var actualHash = Convert.ToBase64String(hashAlgorithm.Hash);

                Assert.Equal("rksygOVuL6+D9BSm49q+nV++GJdlRMBf7RIazLhbU/w=", actualHash);
            }
        }