public void testDecodeVersion1_2() { IDecoder decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createTestSequenceV12Bytes()); TestSequenceV12 val = decoder.decode <TestSequenceV12>(stream); Assert.AreEqual(val.AttrStr, coderTestUtils.createTestSequenceV12().AttrStr); Assert.AreEqual(val.AttrStr2.Value, coderTestUtils.createTestSequenceV12().AttrStr2.Value); checkArray(val.AttrArr, coderTestUtils.createTestSequenceV12().AttrArr); checkBitString(val.AttrBitStr, coderTestUtils.createTestSequenceV12().AttrBitStr); TestSequenceV12 valWithDef = coderTestUtils.createTestSequenceV12(); valWithDef.initWithDefaults(); checkBitString(val.AttrBitStrDef, valWithDef.AttrBitStrDef); checkBitString(val.AttrBoxBitStr.Value, coderTestUtils.createTestSequenceV12().AttrBoxBitStr.Value); }
public TestSequenceV12 createTestSequenceV12() { TestSequenceV12 result = new TestSequenceV12(); result.AttrSimple = ("aba"); ICollection <String> array = new List <String>(); array.Add("aaaa"); array.Add("bbb"); result.AttrArr = (array); result.AttrBitStr = (new BitString(new byte[] { (byte)0x99, (byte)0x80 }, 1)); result.AttrBitStrBnd = (new BitString(new byte[] { (byte)0xF0 }, 4)); result.AttrBoxBitStr = (new TestBitStrBnd(new BitString(new byte[] { (byte)0xA0 }, 4))); result.AttrStr = ("cccc"); result.AttrStr2 = (new TestPRN("dddddd")); result.AttrStrict = (new byte[] { 0x0A, 0x0B, 0x0C, 0x0D }); return(result); }