< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Description.MessagePartDescription
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/MessagePartDescription.cs
Line coverage
72%
Covered lines: 31
Uncovered lines: 12
Coverable lines: 43
Total lines: 105
Line coverage: 72%
Branch coverage
62%
Covered branches: 5
Total branches: 8
Branch coverage: 62.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)75%4487.5%
.ctor(...)100%11100%
.ctor(...)100%110%
Clone()100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/MessagePartDescription.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;
 5using System.Net.Security;
 6using System.Reflection;
 7using CoreWCF.Security;
 8
 9namespace CoreWCF.Description
 10{
 11    public class MessagePartDescription
 12    {
 13        private ProtectionLevel _protectionLevel;
 14        private bool _hasProtectionLevel;
 15
 16        private ICustomAttributeProvider _additionalAttributesProvider;
 17
 488618        public MessagePartDescription(string name, string ns)
 19        {
 488620            if (name == null)
 21            {
 022                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(name), SR.SFxParameterNameCannot
 23            }
 24
 488625            XmlName = new XmlName(name, true /*isEncoded*/);
 26
 488627            if (!string.IsNullOrEmpty(ns))
 28            {
 487929                NamingHelper.CheckUriParameter(ns, nameof(ns));
 30            }
 31
 488632            Namespace = ns;
 488633        }
 34
 9635        internal MessagePartDescription(MessagePartDescription other)
 36        {
 9637            XmlName = other.XmlName;
 9638            Namespace = other.Namespace;
 9639            Index = other.Index;
 9640            Type = other.Type;
 9641            SerializationPosition = other.SerializationPosition;
 9642            _hasProtectionLevel = other._hasProtectionLevel;
 9643            _protectionLevel = other._protectionLevel;
 9644            MemberInfo = other.MemberInfo;
 9645            Multiple = other.Multiple;
 9646            _additionalAttributesProvider = other._additionalAttributesProvider;
 47            //this.baseType = other.baseType;
 48            //this.uniquePartName = other.uniquePartName;
 9649        }
 50
 051        internal MessagePartDescription(MessagePartDescription other, string name, string ns) : this(other)
 52        {
 053            XmlName = new XmlName(name, true /*isEncoded*/);
 054            Namespace = ns;
 055        }
 56
 57        public virtual MessagePartDescription Clone()
 58        {
 9659            return new MessagePartDescription(this);
 60        }
 61
 1156162        internal XmlName XmlName { get; }
 63
 64        public string Name
 65        {
 1132166            get { return XmlName.EncodedName; }
 67        }
 68
 1308569        public string Namespace { get; }
 70
 4887771        public Type Type { get; set; }
 72
 779173        public int Index { get; set; }
 74
 506075        public bool Multiple { get; set; }
 76
 77        public ProtectionLevel ProtectionLevel
 78        {
 079            get { return _protectionLevel; }
 80            set
 81            {
 082                if (!ProtectionLevelHelper.IsDefined(value))
 83                {
 084                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(val
 85                }
 86
 087                _protectionLevel = value;
 088                _hasProtectionLevel = true;
 089            }
 90        }
 49791        public MemberInfo MemberInfo { get; set; }
 92
 093        internal bool HasProtectionLevel => false;
 94
 95        internal ICustomAttributeProvider AdditionalAttributesProvider
 96        {
 18197            get { return _additionalAttributesProvider ?? MemberInfo; }
 922898            set { _additionalAttributesProvider = value; }
 99        }
 100
 451101        internal string UniquePartName { get; set; }
 102
 415103        internal int SerializationPosition { get; set; }
 104    }
 105}