public void Write()
        {
            var source = new MemoryStream();
            var stream = new HashingWriteStream(null, source, new SHA256CryptoServiceProvider());

            stream.Write(textBytes, 0, textBytes.Length);

            Assert.That(Encoding.UTF8.GetString(source.ToArray()), Is.EqualTo(text));
        }
        public void ComputesHash()
        {
            var stream = new HashingWriteStream(null, new MemoryStream(), new SHA256CryptoServiceProvider());

            stream.Write(textBytes, 0, textBytes.Length);
            stream.Close();

            var expectedHash = new SHA256CryptoServiceProvider().ComputeHash(textBytes);

            Assert.That(stream.Hash, Is.EqualTo(expectedHash));
        }