public void TestBasic() { byte[] data = HexRead.ReadFromString("7D 00 0C 00 14 00 9B 00 C7 19 0F 00 01 13 00 00"); RecordInputStream in1 = TestcaseRecordInputStream.Create(data); ColumnInfoRecord cir = new ColumnInfoRecord(in1); Assert.AreEqual(0, in1.Remaining); Assert.AreEqual(20, cir.FirstColumn); Assert.AreEqual(155, cir.LastColumn); Assert.AreEqual(6599, cir.ColumnWidth); Assert.AreEqual(15, cir.XFIndex); Assert.AreEqual(true, cir.IsHidden); Assert.AreEqual(3, cir.OutlineLevel); Assert.AreEqual(true, cir.IsCollapsed); Assert.IsTrue(Arrays.Equals(data, cir.Serialize())); }
public void TestZeroResevedBytes_bug48332() { // Taken from bugzilla attachment 24661 (offset 0x1E73) byte[] inpData = HexRead.ReadFromString("7D 00 0A 00 00 00 00 00 D5 19 0F 00 02 00"); byte[] outData = HexRead.ReadFromString("7D 00 0C 00 00 00 00 00 D5 19 0F 00 02 00 00 00"); RecordInputStream in1 = TestcaseRecordInputStream.Create(inpData); ColumnInfoRecord cir; try { cir = new ColumnInfoRecord(in1); } catch (RuntimeException e) { if (e.Message.Equals("Unusual record size remaining=(0)")) { throw new AssertionException("Identified bug 48332"); } throw e; } Assert.AreEqual(0, in1.Remaining); Assert.IsTrue(Arrays.Equals(outData, cir.Serialize())); }
public void TestOneReservedByte() { byte[] inpData = HexRead.ReadFromString("7D 00 0B 00 00 00 00 00 24 02 0F 00 00 00 01"); byte[] outData = HexRead.ReadFromString("7D 00 0C 00 00 00 00 00 24 02 0F 00 00 00 01 00"); RecordInputStream in1 = TestcaseRecordInputStream.Create(inpData); ColumnInfoRecord cir = new ColumnInfoRecord(in1); Assert.AreEqual(0, in1.Remaining); Assert.IsTrue(Arrays.Equals(outData, cir.Serialize())); }