[TestCase(new byte[0], 0, 0)]
[TestCase(new byte[] { 1, 2, 3 }, 1, 2)]
[TestCase(new byte[] { 1, 2, 3 }, 0, 2)]
[TestCase(new byte[] { 1, 2, 3 }, 1, 1)]
[TestCase(new byte[] { 1, 2, 3 }, 0, 3)]
public void StreamCompressAndRegularDecompress(byte[] data, int offset, int count)
{
var tempStream = new MemoryStream();
using (var compressionStream = new CompressionStream(tempStream))
compressionStream.Write(data, offset, count);
byte[] decompressedBytes;
using (Decompressor decompressor = new Decompressor())
{
decompressedBytes = decompressor.Unwrap(tempStream.ToArray());
}
var dataToCompress = new byte[count];
Array.Copy(data, offset, dataToCompress, 0, count);
Assert.AreEqual(dataToCompress, decompressedBytes);
}