< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.MessageContractAttribute
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/MessageContractAttribute.cs
Line coverage
78%
Covered lines: 11
Uncovered lines: 3
Coverable lines: 14
Total lines: 80
Line coverage: 78.5%
Branch coverage
66%
Covered branches: 4
Total branches: 6
Branch coverage: 66.6%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/MessageContractAttribute.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    [AttributeUsage(CoreWCFAttributeTargets.MessageContract, AllowMultiple = false)]
 10    public sealed class MessageContractAttribute : Attribute
 11    {
 12        private string _wrappedName;
 13        private string _wrappedNs;
 14        //ProtectionLevel protectionLevel = ProtectionLevel.None;
 15        //bool hasProtectionLevel = false;
 16
 17        //internal const string ProtectionLevelPropertyName = "ProtectionLevel";
 18        //public ProtectionLevel ProtectionLevel
 19        //{
 20        //    get
 21        //    {
 22        //        return this.protectionLevel;
 23        //    }
 24        //    set
 25        //    {
 26        //        if (!ProtectionLevelHelper.IsDefined(value))
 27        //            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value")
 28        //        this.protectionLevel = value;
 29        //        this.hasProtectionLevel = true;
 30        //    }
 31        //}
 32
 33        //public bool HasProtectionLevel
 34        //{
 35        //    get { return this.hasProtectionLevel; }
 36        //}
 37
 65938        public bool IsWrapped { get; set; } = true;
 39
 40        public string WrapperName
 41        {
 42            get
 43            {
 16644                return _wrappedName;
 45            }
 46            set
 47            {
 2648                if (value == null)
 49                {
 050                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value));
 51                }
 52
 2653                if (value == string.Empty)
 54                {
 055                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(val
 056                        SR.SFxWrapperNameCannotBeEmpty));
 57                }
 58
 2659                _wrappedName = value;
 2660            }
 61        }
 62
 63        public string WrapperNamespace
 64        {
 65            get
 66            {
 16667                return _wrappedNs;
 68            }
 69            set
 70            {
 2071                if (!string.IsNullOrEmpty(value))
 72                {
 2073                    NamingHelper.CheckUriProperty(value, "WrapperNamespace");
 74                }
 75
 2076                _wrappedNs = value;
 2077            }
 78        }
 79    }
 80}