< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Description.FaultDescription
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/FaultDescription.cs
Line coverage
78%
Covered lines: 11
Uncovered lines: 3
Coverable lines: 14
Total lines: 45
Line coverage: 78.5%
Branch coverage
50%
Covered branches: 1
Total branches: 2
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%
SetNameAndElement(...)100%11100%
SetNameOnly(...)100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/FaultDescription.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;
 5
 6namespace CoreWCF.Description
 7{
 8    public class FaultDescription
 9    {
 10        private XmlName _name;
 11
 16212        public FaultDescription(string action)
 13        {
 16214            Action = action ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(action));
 16215        }
 16
 32417        public string Action { get; internal set; }
 18
 19        // Not serializable on purpose, metadata import/export cannot
 20        // produce it, only available when binding to runtime
 49221        public Type DetailType { get; set; }
 22
 23        public string Name
 24        {
 025            get { return _name.EncodedName; }
 026            set { SetNameAndElement(new XmlName(value, true /*isEncoded*/)); }
 27        }
 28
 32429        public string Namespace { get; set; }
 30
 44431        internal XmlName ElementName { get; set; }
 32
 033        internal bool HasProtectionLevel => false;
 34
 35        internal void SetNameAndElement(XmlName name)
 36        {
 3037            ElementName = _name = name;
 3038        }
 39
 40        internal void SetNameOnly(XmlName name)
 41        {
 13242            _name = name;
 13243        }
 44    }
 45}