Ejemplo n.º 1
0
 public MethodImplEntry(MetadataDirectory directory, MethodImplMetadataTableRow row)
 {
     this.FileOffset        = string.Format("0x{0:x}", row.FileOffset);
     this.Class             = row.Class.Value.ToString();
     this.MethodBody        = row.MethodBody.ToString();
     this.MethodDecleration = row.MethodDeclaration.ToString();
 }
Ejemplo n.º 2
0
        public void MethodImpl_WhenCreated_OffsetIsMovedOn()
        {
            byte[] contents = new byte[6];
            Offset offset   = 0;
            ICodedIndexResolver resolver     = IndexHelper.CreateCodedIndexResolver(2);
            IIndexDetails       indexDetails = IndexHelper.CreateIndexDetails(2);

            MethodImplMetadataTableRow row = new MethodImplMetadataTableRow(contents, offset, resolver, indexDetails);

            Assert.AreEqual(6, offset.Current);
        }
Ejemplo n.º 3
0
        public void MethodImpl_WhenCreated_FieldsAreReadCorrectly()
        {
            byte[] contents = new byte[] {
                0x01, 0x00,
                0x00, 0x00,
                0x00, 0x00
            };
            ICodedIndexResolver resolver     = IndexHelper.CreateCodedIndexResolver(2);
            IIndexDetails       indexDetails = IndexHelper.CreateIndexDetails(2);

            MethodImplMetadataTableRow row = new MethodImplMetadataTableRow(contents, 0, resolver, indexDetails);

            Assert.AreEqual(1, row.Class.Value);
            Assert.IsNotNull(row.MethodBody);
            Assert.IsNotNull(row.MethodDeclaration);
        }