< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 40
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
GetCustomAttributes()100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/InterfaceImplementation.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 struct InterfaceImplementation
 7    {
 8        private readonly MetadataReader _reader;
 9
 10        // Workaround: JIT doesn't generate good code for nested structures, so use RowId.
 11        private readonly int _rowId;
 12
 13        internal InterfaceImplementation(MetadataReader reader, InterfaceImplementationHandle handle)
 014        {
 015            _reader = reader;
 016            _rowId = handle.RowId;
 017        }
 18
 19        private InterfaceImplementationHandle Handle
 20        {
 021            get { return InterfaceImplementationHandle.FromRowId(_rowId); }
 22        }
 23
 24
 25        /// <summary>
 26        /// The interface that is implemented
 27        /// <see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/>, or <see cref="TypeSpecificationHandle
 28        /// </summary>
 29        public EntityHandle Interface
 30        {
 031            get { return _reader.InterfaceImplTable.GetInterface(_rowId); }
 32        }
 33
 34        public CustomAttributeHandleCollection GetCustomAttributes()
 035        {
 036            return new CustomAttributeHandleCollection(_reader, Handle);
 037        }
 38    }
 39}
 40