Ejemplo n.º 1
0
 public int Compress()
 {
     using (var inputStream = File.OpenRead(InputFile))
         using (var outputStream = File.Open(TargetFile, FileMode.OpenOrCreate, FileAccess.ReadWrite))
         {
             var(ratio, _) = streamCompressor.Compress(inputStream, outputStream);
             return(ratio);
         }
 }
Ejemplo n.º 2
0
            public void Should_fail_when_given_null_input_stream()
            {
                Action action = () => streamCompressor.Compress(null, new MemoryStream());

                action.Should().Throw <ArgumentNullException>();
            }