public void TestSerialize() { UnknownEscherRecord r = new UnknownEscherRecord(); r.Options=(short)0x123F; r.RecordId=unchecked((short)0xF112); byte[] data = new byte[8]; r.Serialize(0, data); Assert.AreEqual("[3F, 12, 12, F1, 00, 00, 00, 00]", HexDump.ToHex(data)); EscherRecord childRecord = new UnknownEscherRecord(); childRecord.Options=unchecked((short)0x9999); childRecord.RecordId=unchecked((short)0xFF01); r.AddChildRecord(childRecord); data = new byte[16]; r.Serialize(0, data); Assert.AreEqual("[3F, 12, 12, F1, 08, 00, 00, 00, 99, 99, 01, FF, 00, 00, 00, 00]", HexDump.ToHex(data)); }
public void TestToString() { UnknownEscherRecord r = new UnknownEscherRecord(); r.Options=(short)0x1234; r.RecordId=unchecked((short)0xF112); byte[] data = new byte[8]; r.Serialize(0, data); String nl = Environment.NewLine; Assert.AreEqual("UnknownEscherRecord:" + nl + " isContainer: False" + nl + " options: 0x1234" + nl + " recordId: 0xF112" + nl + " numchildren: 0" + nl , r.ToString()); }