< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.MessageContractMemberAttribute
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/MessageContractMemberAttribute.cs
Line coverage
77%
Covered lines: 14
Uncovered lines: 4
Coverable lines: 18
Total lines: 83
Line coverage: 77.7%
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

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/MessageContractMemberAttribute.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 CoreWCF.Description;
 6
 7namespace CoreWCF
 8{
 9    public abstract class MessageContractMemberAttribute : Attribute
 10    {
 11        private string _name;
 12        private string _ns;
 13
 14        //ProtectionLevel protectionLevel = ProtectionLevel.None;
 15        //bool hasProtectionLevel = false;
 16
 17        internal const string NamespacePropertyName = "Namespace";
 18        public string Namespace
 19        {
 1420            get { return _ns; }
 21            set
 22            {
 2823                if (value == null)
 24                {
 025                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value));
 26                }
 27
 2828                if (value.Length > 0)
 29                {
 1230                    NamingHelper.CheckUriProperty(value, "Namespace");
 31                }
 2832                _ns = value;
 2833                IsNamespaceSetExplicit = true;
 2834            }
 35        }
 36
 21837        internal bool IsNamespaceSetExplicit { get; private set; }
 38
 39        internal const string NamePropertyName = "Name";
 40        public string Name
 41        {
 342            get { return _name; }
 43            set
 44            {
 345                if (value == null)
 46                {
 047                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value));
 48                }
 49
 350                if (value == string.Empty)
 51                {
 052                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(val
 053                        SR.SFxNameCannotBeEmpty));
 54                }
 55
 656                _name = value; IsNameSetExplicit = true;
 357            }
 58        }
 59
 19360        internal bool IsNameSetExplicit { get; private set; }
 61
 62        //internal const string ProtectionLevelPropertyName = "ProtectionLevel";
 63        //public ProtectionLevel ProtectionLevel
 64        //{
 65        //    get
 66        //    {
 67        //        return this.protectionLevel;
 68        //    }
 69        //    set
 70        //    {
 71        //        if (!ProtectionLevelHelper.IsDefined(value))
 72        //            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(v
 73        //        this.protectionLevel = value;
 74        //        this.hasProtectionLevel = true;
 75        //    }
 76        //}
 77
 78        //public bool HasProtectionLevel
 79        //{
 80        //    get { return this.hasProtectionLevel; }
 81        //}
 82    }
 83}