title: How to write unit tests for methods that compress and decompress?
body: <p>I need to write unit tests for methods that compress and decompress an <code>ArraySegment</code> object. There are plenty of strange treatments inside these methods which I do not need to understand. (They also use some system methods — I don't know their implementation.)</p>
  
  <p>The problem lies in how to actually test such things. I could check what the result is for the compression method for concrete input — <code>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</code> — and create a test case based on this experiment, but this solution doesn't test any border cases.</p>
  
  <p>I could also test whether doing compression and then decompression on some sequence gives me the first input sequence, but that would not be a pure unit test. </p>
  
  <p>Have you ever come across such a problem? Is there any good solution for it?</p>