Esempio n. 1
0
        public virtual void testEncodeString()
        {
            IEncoder encoder = newEncoder();

            Assert.IsNotNull(encoder);
            printEncoded("TestPRN", encoder, coderTestUtils.createTestPRN());
            checkEncoded(encoder, coderTestUtils.createTestPRN(), coderTestUtils.createTestPRNBytes());

            printEncoded("TestOCT", encoder, coderTestUtils.createTestOCT());
            checkEncoded(encoder, coderTestUtils.createTestOCT(), coderTestUtils.createTestOCTBytes());
        }
Esempio n. 2
0
        public virtual void testDecodeString()
        {
            IDecoder decoder = newDecoder();

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

            Assert.IsNotNull(val);
            Assert.AreEqual(val.Value, coderTestUtils.createTestPRN().Value);

            stream = new System.IO.MemoryStream((coderTestUtils.createTestOCTBytes()));
            TestOCT valOct = decoder.decode <TestOCT>(stream);

            Assert.IsNotNull(valOct);
            ByteTools.checkBuffers(valOct.Value, coderTestUtils.createTestOCT().Value);
        }