Exemple #1
0
        public void FieldLayout_WhenCreated_OffsetIsMovedOn()
        {
            Offset offset = 0;

            byte[]        contents     = new byte[10];
            IIndexDetails indexDetails = IndexHelper.CreateIndexDetails(2);

            FieldLayoutMetadataTableRow row = new FieldLayoutMetadataTableRow(contents, offset, indexDetails);

            Assert.AreEqual(6, offset.Current);
        }
Exemple #2
0
        public void FieldLayout_WhenCreated_ReadFieldsCorrectly()
        {
            byte[] contents = new byte[] {
                0x01, 0x00, 0x00, 0x00,
                0x01, 0x00
            };
            IIndexDetails indexDetails = IndexHelper.CreateIndexDetails(2);

            FieldLayoutMetadataTableRow row = new FieldLayoutMetadataTableRow(contents, 0, indexDetails);

            Assert.AreEqual(1, row.Offset);
            Assert.AreEqual(1, row.Field.Value);
        }
 public FieldLayoutEntry(MetadataDirectory directory, FieldLayoutMetadataTableRow row)
 {
     this.FileOffset = string.Format("0x{0:x}", row.FileOffset);
     this.Field      = row.Field.Value.ToString();
     this.Offset     = string.Format("0x{0:x}", row.Offset);
 }