public virtual void testNegativeInteger() { IEncoder encoder = newEncoder(); Assert.IsNotNull(encoder); printEncoded("Negative integer test", encoder, coderTestUtils.createTestNI()); checkEncoded(encoder, coderTestUtils.createTestNI(), coderTestUtils.createTestNIBytes()); printEncoded("Negative integer test 2", encoder, coderTestUtils.createTestNI2()); checkEncoded(encoder, coderTestUtils.createTestNI2(), coderTestUtils.createTestNI2Bytes()); }
public virtual void testDecodeNegativeInteger() { IDecoder decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestNIBytes()); TestNI val = decoder.decode <TestNI>(stream); Assert.AreEqual(val.Value, coderTestUtils.createTestNI().Value); stream = new System.IO.MemoryStream(coderTestUtils.createTestNI2Bytes()); TestNI2 val2 = decoder.decode <TestNI2>(stream); Assert.AreEqual(val2.Value, coderTestUtils.createTestNI2().Value); }