< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.EnvelopeVersion
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/EnvelopeVersion.cs
Line coverage
96%
Covered lines: 59
Uncovered lines: 2
Coverable lines: 61
Total lines: 105
Line coverage: 96.7%
Branch coverage
75%
Covered branches: 6
Total branches: 8
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%44100%
.cctor()100%11100%
GetUltimateDestinationActorValues()100%110%
IsUltimateDestinationActor(...)50%44100%
ToString()100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/EnvelopeVersion.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.Xml;
 5
 6namespace CoreWCF
 7{
 8    public sealed class EnvelopeVersion
 9    {
 10        private readonly string _actor;
 11        private readonly string _toStringFormat;
 12
 3613        private EnvelopeVersion(string ultimateReceiverActor, string nextDestinationActorValue,
 3614            string ns, XmlDictionaryString dictionaryNs, string actor, XmlDictionaryString dictionaryActor,
 3615            string toStringFormat, string senderFaultName, string receiverFaultName)
 16        {
 3617            _toStringFormat = toStringFormat;
 3618            UltimateDestinationActor = ultimateReceiverActor;
 3619            NextDestinationActorValue = nextDestinationActorValue;
 3620            Namespace = ns;
 3621            DictionaryNamespace = dictionaryNs;
 3622            _actor = actor;
 3623            DictionaryActor = dictionaryActor;
 3624            SenderFaultName = senderFaultName;
 3625            ReceiverFaultName = receiverFaultName;
 26
 3627            if (ultimateReceiverActor != null)
 28            {
 2429                if (ultimateReceiverActor.Length == 0)
 30                {
 1231                    MustUnderstandActorValues = new string[] { "", nextDestinationActorValue };
 1232                    UltimateDestinationActorValues = new string[] { "", nextDestinationActorValue };
 33                }
 34                else
 35                {
 1236                    MustUnderstandActorValues = new string[] { "", ultimateReceiverActor, nextDestinationActorValue };
 1237                    UltimateDestinationActorValues = new string[] { "", ultimateReceiverActor, nextDestinationActorValue
 38                }
 39            }
 2440        }
 41
 1454342        internal XmlDictionaryString DictionaryActor { get; }
 43
 404144        public string Namespace { get; }
 45
 7247946        public XmlDictionaryString DictionaryNamespace { get; }
 47
 2648        public string NextDestinationActorValue { get; }
 49
 12142650        public static EnvelopeVersion None { get; } = new EnvelopeVersion(
 1251            null,
 1252            null,
 1253            MessageStrings.Namespace,
 1254            XD.MessageDictionary.Namespace,
 1255            null,
 1256            null,
 1257            SR.EnvelopeNoneToStringFormat,
 1258            "Sender",
 1259            "Receiver");
 60
 285361        public static EnvelopeVersion Soap11 { get; } = new EnvelopeVersion(
 1262            "",
 1263            "http://schemas.xmlsoap.org/soap/actor/next",
 1264            Message11Strings.Namespace,
 1265            XD.Message11Dictionary.Namespace,
 1266            Message11Strings.Actor,
 1267            XD.Message11Dictionary.Actor,
 1268            SR.Soap11ToStringFormat,
 1269            "Client",
 1270            "Server");
 71
 2326472        public static EnvelopeVersion Soap12 { get; } = new EnvelopeVersion(
 1273            "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver",
 1274            "http://www.w3.org/2003/05/soap-envelope/role/next",
 1275            Message12Strings.Namespace,
 1276            XD.Message12Dictionary.Namespace,
 1277            Message12Strings.Role,
 1278            XD.Message12Dictionary.Role,
 1279            SR.Soap12ToStringFormat,
 1280            "Sender",
 1281            "Receiver");
 82
 18783        internal string ReceiverFaultName { get; }
 84
 085        internal string[] MustUnderstandActorValues { get; }
 86
 1387        internal string UltimateDestinationActor { get; }
 88
 089        public string[] GetUltimateDestinationActorValues() => (string[])UltimateDestinationActorValues.Clone();
 90
 4891        internal string[] UltimateDestinationActorValues { get; }
 92
 93        internal bool IsUltimateDestinationActor(string actor)
 94        {
 483795            return actor.Length == 0 || actor == UltimateDestinationActor || actor == NextDestinationActorValue;
 96        }
 97
 98        public override string ToString()
 99        {
 34100            return SR.Format(_toStringFormat, Namespace);
 101        }
 102
 339103        internal string SenderFaultName { get; }
 104    }
 105}