Ejemplo n.º 1
0
        public void PointerBytePointSpanIs4096WhenSize12()
        {
            uint expected = 4096;

            var actual = PointerByte.GetPointerSpan();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
            public void ReturnsPointer_257_2_From_10001000000010001()
            {
                var lzByteConverter = new LZByteConverter();
                var expected        = new PointerByte(258, 2);
                var ub = new UnevenByte(69649, 17);

                var actual = lzByteConverter.ToEncodedByte(ub) as PointerByte;

                Assert.AreEqual(expected, actual);
            }
Ejemplo n.º 3
0
            public void ToUnevenBytePointerByte_150_9_returns_67945()
            {
                var           lzByteConverter = new LZByteConverter();
                uint          expected        = 67945;
                EncodedLZByte pb = new PointerByte(150, 9);

                var actual = lzByteConverter.ToUnevenByte(pb).Data;

                Assert.AreEqual(expected, actual);
            }
Ejemplo n.º 4
0
            public void ReturnsPointer_17_4_From_10000000100010100()
            {
                var lzByteConverter = new LZByteConverter();
                var expected        = new PointerByte(18, 5);
                var ub = new UnevenByte(0b10000000100010100, 17);

                var actual = lzByteConverter.ToEncodedByte(ub) as PointerByte;

                Assert.AreEqual(expected, actual);
            }
Ejemplo n.º 5
0
        public void SlideReturnsPointerLength_2_FromTestFile2AtPos10()
        {
            var path     = TestContext.CurrentContext.TestDirectory + "../../../res/testfile2";
            var file     = new DataFile(path);
            var sw       = new SlidingWindow(file.GetAllBytes());
            var expected = new PointerByte(5, 2);

            for (var i = 0; i < 9; i++)
            {
                Console.WriteLine(sw.Slide());
            }

            var actual = (PointerByte)sw.Slide();

            Assert.AreEqual(expected, actual);
        }