public void AssemblyRef_WhenConstructed_ValuesAreCorrect()
        {
            byte[] content =
            {
                0x04, 0x00,
                0x01, 0x00,
                0x00, 0x00,
                0x00, 0x00,
                0x00, 0x00, 0x00, 0x00,
                0x63, 0x03,
                0xD9, 0x03,
                0x00, 0x00,
                0x00, 0x00
            };
            IIndexDetails indexDetails = IndexHelper.CreateIndexDetails(2);

            AssemblyRefMetadataTableRow row = new AssemblyRefMetadataTableRow(content, 0, indexDetails);

            Assert.AreEqual("4.1.0.0", row.GetVersion().ToString());
            Assert.AreEqual(AssemblyFlags.SideBySideCompatible, row.Flags);
            Assert.AreEqual(867, row.PublicKeyOrToken);
            Assert.AreEqual(985, row.Name.Value);
            Assert.AreEqual(0, row.Culture.Value);
            Assert.AreEqual(0, row.HashValue);
        }
Пример #2
0
 public AssemblyRefEntry(MetadataDirectory directory, AssemblyRefMetadataTableRow row)
 {
     this.FileOffset       = string.Format("0x{0:x}", row.FileOffset);
     this.Name             = ((StringStream)directory.Streams[Streams.StringStream]).GetString(row.Name.Value);
     this.Version          = row.GetVersion().ToString();
     this.Culture          = ((StringStream)directory.Streams[Streams.StringStream]).GetString(row.Culture.Value);
     this.HashValue        = row.HashValue.ToString();
     this.Flags            = row.Flags.ToString();
     this.PublicKeyOrToken = row.PublicKeyOrToken.ToString();
 }