< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 22
Coverable lines: 22
Total lines: 64
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/ModuleDefinition.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 struct ModuleDefinition
 9    {
 10        private readonly MetadataReader _reader;
 11
 12        internal ModuleDefinition(MetadataReader reader)
 013        {
 014            Debug.Assert(reader != null);
 015            _reader = reader;
 016        }
 17
 18        public int Generation
 19        {
 20            get
 021            {
 022                return _reader.ModuleTable.GetGeneration();
 023            }
 24        }
 25
 26        public StringHandle Name
 27        {
 28            get
 029            {
 030                return _reader.ModuleTable.GetName();
 031            }
 32        }
 33
 34        public GuidHandle Mvid
 35        {
 36            get
 037            {
 038                return _reader.ModuleTable.GetMvid();
 039            }
 40        }
 41
 42        public GuidHandle GenerationId
 43        {
 44            get
 045            {
 046                return _reader.ModuleTable.GetEncId();
 047            }
 48        }
 49
 50        public GuidHandle BaseGenerationId
 51        {
 52            get
 053            {
 054                return _reader.ModuleTable.GetEncBaseId();
 055            }
 56        }
 57
 58        public CustomAttributeHandleCollection GetCustomAttributes()
 059        {
 060            return new CustomAttributeHandleCollection(_reader, EntityHandle.ModuleDefinition);
 061        }
 62    }
 63}
 64