Пример #1
0
        public void testEncodeLongTag()
        {
            IEncoder encoder = newEncoder();

            Assert.NotNull(encoder);
            printEncoded("EncodeTestLongTag: ", encoder, coderTestUtils.createTestLongTag());
            checkEncoded(encoder, coderTestUtils.createTestLongTag(), coderTestUtils.createTestLongTagBytes());

            printEncoded("EncodeTest128Tag: ", encoder, coderTestUtils.createTest128Tag());
            checkEncoded(encoder, coderTestUtils.createTest128Tag(), coderTestUtils.createTest128TagBytes());
        }
Пример #2
0
        public void testDecodeLongTag()
        {
            IDecoder decoder = newDecoder();

            System.IO.MemoryStream stream =
                new System.IO.MemoryStream(coderTestUtils.createTestLongTagBytes());
            TestLongTag val = decoder.decode <TestLongTag>(stream);

            Assert.Equals(val.Value, coderTestUtils.createTestLongTag().Value);

            stream =
                new System.IO.MemoryStream(coderTestUtils.createTest128TagBytes());
            Test128Tag val2 = decoder.decode <Test128Tag>(stream);

            Assert.Equals(val2.Value, coderTestUtils.createTest128Tag().Value);
        }