< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.FaultContractAttribute
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/FaultContractAttribute.cs
Line coverage
75%
Covered lines: 15
Uncovered lines: 5
Coverable lines: 20
Total lines: 66
Line coverage: 75%
Branch coverage
50%
Covered branches: 5
Total branches: 10
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)50%22100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/FaultContractAttribute.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.OperationContract, AllowMultiple = true, Inherited = false)]
 10    public sealed class FaultContractAttribute : Attribute
 11    {
 12        private string _action;
 13        private string _name;
 14        private string _ns;
 15
 111116        public FaultContractAttribute(Type detailType)
 17        {
 111118            DetailType = detailType ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(detailTyp
 111119        }
 20
 29421        public Type DetailType { get; }
 22
 23        public string Action
 24        {
 16225            get { return _action; }
 26            set
 27            {
 028                _action = value ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value));
 029            }
 30        }
 31
 32        public string Name
 33        {
 32434            get { return _name; }
 35            set
 36            {
 18637                if (value == null)
 38                {
 039                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value));
 40                }
 41
 18642                if (value == string.Empty)
 43                {
 044                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(val
 045                        SR.SFxNameCannotBeEmpty));
 46                }
 47
 18648                _name = value;
 18649            }
 50        }
 51
 52        public string Namespace
 53        {
 16254            get { return _ns; }
 55            set
 56            {
 1657                if (!string.IsNullOrEmpty(value))
 58                {
 1659                    NamingHelper.CheckUriProperty(value, "Namespace");
 60                }
 61
 1662                _ns = value;
 1663            }
 64        }
 65    }
 66}