< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 44
Coverable lines: 44
Total lines: 118
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
File 1: .ctor(...)100%110%
File 1: GetCustomAttributes()100%110%
File 1: GetDeclarativeSecurityAttributes()100%110%
File 2: GetAssemblyName()0%220%
File 2: GetAssemblyNameInfo()0%220%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/AssemblyDefinition.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Diagnostics;
 5
 6namespace System.Reflection.Metadata
 7{
 8    public readonly partial struct AssemblyDefinition
 9    {
 10        private readonly MetadataReader _reader;
 11
 12        internal AssemblyDefinition(MetadataReader reader)
 013        {
 014            Debug.Assert(reader != null);
 015            _reader = reader;
 016        }
 17
 18        public AssemblyHashAlgorithm HashAlgorithm
 19        {
 20            get
 021            {
 022                return _reader.AssemblyTable.GetHashAlgorithm();
 023            }
 24        }
 25
 26        public Version Version
 27        {
 28            get
 029            {
 030                return _reader.AssemblyTable.GetVersion();
 031            }
 32        }
 33
 34        public AssemblyFlags Flags
 35        {
 36            get
 037            {
 038                return _reader.AssemblyTable.GetFlags();
 039            }
 40        }
 41
 42        public StringHandle Name
 43        {
 44            get
 045            {
 046                return _reader.AssemblyTable.GetName();
 047            }
 48        }
 49
 50        public StringHandle Culture
 51        {
 52            get
 053            {
 054                return _reader.AssemblyTable.GetCulture();
 055            }
 56        }
 57
 58        public BlobHandle PublicKey
 59        {
 60            get
 061            {
 062                return _reader.AssemblyTable.GetPublicKey();
 063            }
 64        }
 65
 66        public CustomAttributeHandleCollection GetCustomAttributes()
 067        {
 068            return new CustomAttributeHandleCollection(_reader, EntityHandle.AssemblyDefinition);
 069        }
 70
 71        public DeclarativeSecurityAttributeHandleCollection GetDeclarativeSecurityAttributes()
 072        {
 073            return new DeclarativeSecurityAttributeHandleCollection(_reader, EntityHandle.AssemblyDefinition);
 074        }
 75    }
 76}
 77

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/AssemblyDefinition.netstandard.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4namespace System.Reflection.Metadata
 5{
 6    public readonly partial struct AssemblyDefinition
 7    {
 8        /// <summary>
 9        /// Creates an <see cref="AssemblyName"/> instance corresponding to this assembly definition.
 10        /// </summary>
 11        public AssemblyName GetAssemblyName()
 012        {
 013            AssemblyFlags flags = Flags;
 14
 15            // compat: assembly names from metadata definitions should set the bit for the full key.
 016            if (!PublicKey.IsNil)
 017            {
 018                flags |= AssemblyFlags.PublicKey;
 019            }
 20
 021            return _reader.GetAssemblyName(Name, Version, Culture, PublicKey, HashAlgorithm, flags);
 022        }
 23
 24        /// <summary>
 25        /// Creates an <see cref="AssemblyNameInfo"/> instance corresponding to this assembly definition.
 26        /// </summary>
 27        public AssemblyNameInfo GetAssemblyNameInfo()
 028        {
 029            AssemblyFlags flags = Flags;
 30
 31            // compat: assembly names from metadata definitions should set the bit for the full key.
 032            if (!PublicKey.IsNil)
 033            {
 034                flags |= AssemblyFlags.PublicKey;
 035            }
 36
 037            return _reader.GetAssemblyNameInfo(Name, Version, Culture, PublicKey, flags);
 038        }
 39    }
 40}
 41