Beispiel #1
0
        public void testEncodeLongTag()
        {
            IEncoder encoder = newEncoder();

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

            printEncoded("EncodeTest128Tag: ", encoder, coderTestUtils.createTest128Tag());
            checkEncoded(encoder, coderTestUtils.createTest128Tag(), coderTestUtils.createTest128TagBytes());
        }
Beispiel #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.AreEqual(val.Value, coderTestUtils.createTestLongTag().Value);

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

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