Пример #1
0
        public void TextTreeTest()
        {
            var data1 = new byte[] { 0, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
            var data2 = new byte[] { 0, 5, 3, 6, 7, 2, 8, 0, 1, 9, 10, 11, 12, 13, 15 };

            var treeBits = new[]
            {
                "00", "01",
                "100", "101",
                "1100", "1101",
                "11100", "11101", "11110",
                "111110",
                "1111110",
                "11111110",
                "111111110",
                "1111111110",
                "11111111110"
            };

            CollectionAssert.AreEqual(treeBits, HuffmanTable.ToTextTree(data1, data2));
        }