コード例 #1
0
        public void Should_compute_for_stream_values(IChecksumImplementation impl, string expectedChecksum)
        {
            byte[] sourceBytes = Encoding.ASCII.GetBytes("CodeBits");
            var    ms          = new MemoryStream(sourceBytes);
            string checksum    = impl.FromStream(ms);

            checksum.ShouldBe(expectedChecksum);
        }
コード例 #2
0
 public void Should_throw_for_null_values(IChecksumImplementation impl)
 {
     Should.Throw <ArgumentNullException>(() => impl.FromBytes(null));
     Should.Throw <ArgumentNullException>(() => impl.FromFile(null));
     Should.Throw <ArgumentNullException>(() => impl.FromFile(null, 4096));
     Should.Throw <ArgumentNullException>(() => impl.FromStream(null));
     Should.Throw <ArgumentNullException>(() => impl.FromString(null));
 }