예제 #1
0
        public void ModuleRef_WhenCreated_OffsetIsMovedOn()
        {
            byte[]        contents     = new byte[2];
            Offset        offset       = 0;
            IIndexDetails indexDetails = IndexHelper.CreateIndexDetails(2);

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

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

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

            Assert.AreEqual(1, row.Name.Value);
        }
 public ModuleRefEntry(MetadataDirectory directory, ModuleRefMetadataTableRow row)
 {
     this.FileOffset = string.Format("0x{0:x}", row.FileOffset);
     this.Name       = ((StringStream)directory.Streams[Streams.StringStream]).GetString(row.Name.Value);
 }