public void MultipleTexts()
        {
            var text1 = Enumerable.Range(1, 70000).Aggregate(new StringBuilder(), (sb, i) => sb.Append(i).AppendLine()).ToString();
            var text2 = Enumerable.Range(20000, 999999).Aggregate(new StringBuilder(), (sb, i) => sb.Append(i).AppendLine()).ToString();

            var compressor = new LineToCharCompressor();

            var compressed1 = compressor.Compress(text1, 40000);
            var compressed2 = compressor.Compress(text2);

            var decompressed1 = compressor.Decompress(compressed1);
            var decompressed2 = compressor.Decompress(compressed2);

            AssertEqual(text1, decompressed1);
            AssertEqual(text2, decompressed2);
        }
        public void Decompress()
        {
            var d          = new LineToCharCompressor();
            var input      = "line1\r\nline2\r\n";
            var compressed = d.Compress(input);
            var result     = d.Decompress(compressed);

            Assert.AreEqual(input, result);
        }
        public void Compress_MoreThan65535Lines_DecompressesCorrectly()
        {
            // More than 65536 to verify any 16-bit limitation.
            var lineList = new StringBuilder();

            for (var i = 0; i < 66000; i++)
            {
                lineList.Append(i + "\n");
            }
            var chars = lineList.ToString();

            var compressor = new LineToCharCompressor();

            var result       = compressor.Compress(chars, sizeof(char));
            var decompressed = compressor.Decompress(result);

            AssertEqual(chars, decompressed);
        }