public void TestBasicSize() { ExternalNameRecord enr = CreateSimpleENR(dataFDS); if (enr.RecordSize == 13) { throw new AssertionException("Identified bug 44695"); } Assert.AreEqual(17, enr.RecordSize); Assert.IsNotNull(enr.Serialize()); }
public void TestPlainName() { ExternalNameRecord enr = CreateSimpleENR(dataPlainName); Assert.AreEqual("Rate_Date", enr.Text); Assert.IsFalse(enr.IsAutomaticLink); Assert.IsFalse(enr.IsBuiltInName); Assert.IsFalse(enr.IsIconifiedPictureLink); Assert.IsFalse(enr.IsOLELink); Assert.IsFalse(enr.IsPicureLink); Assert.IsFalse(enr.IsStdDocumentNameIdentifier); TestcaseRecordInputStream.ConfirmRecordEncoding(0x0023, dataPlainName, enr.Serialize()); }
public void TestNPEWithFileFrom49219() { // the file at test-data/spreadsheet/49219.xls has ExternalNameRecords without actual data, // we did handle this during Reading, but failed during serializing this out1, ensure it works now byte[] data = new byte[] { 2, 127, 0, 0, 0, 0, 9, 0, 82, 97, 116, 101, 95, 68, 97, 116, 101 }; ExternalNameRecord enr = CreateSimpleENR(data); byte[] ser = enr.Serialize(); Assert.AreEqual("[23, 00, 11, 00, 02, 7F, 00, 00, 00, 00, 09, 00, 52, 61, 74, 65, 5F, 44, 61, 74, 65]", HexDump.ToHex(ser)); }
public void TestBasicDeserializeReserialize() { ExternalNameRecord enr = CreateSimpleENR(dataFDS); Assert.AreEqual("FDS", enr.Text); try { TestcaseRecordInputStream.ConfirmRecordEncoding(0x0023, dataFDS, enr.Serialize()); } catch (IndexOutOfRangeException e) { if (e.Message.Equals("15")) { throw new AssertFailedException("Identified bug 44695"); } } }