Example #1
0
        public void Should_throw_if_file_not_found(IChecksumImplementation impl)
        {
            Should.Throw <FileNotFoundException>(() => impl.FromFile(string.Empty));
            Should.Throw <FileNotFoundException>(() => impl.FromFile(string.Empty, 4096));

            Should.Throw <FileNotFoundException>(() => impl.FromFile(@"Z:\should_not_exist.txt"));
            Should.Throw <FileNotFoundException>(() => impl.FromFile(@"Z:\should_not_exist.txt", 4096));
        }
Example #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));
 }