< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.MessageHeaderException
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/MessageHeaderException.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 29
Coverable lines: 29
Total lines: 70
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
.ctor(...)100%110%
.ctor(...)100%110%
.ctor(...)100%110%
.ctor(...)100%110%
.ctor(...)100%110%
.ctor(...)100%110%
ProvideFault(...)100%110%
.ctor()100%110%
.ctor(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/MessageHeaderException.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 System.Runtime.Serialization;
 6using CoreWCF.Channels;
 7using CoreWCF.Runtime;
 8
 9namespace CoreWCF
 10{
 11    [Serializable]
 12    public class MessageHeaderException : ProtocolException
 13    {
 14        public MessageHeaderException(string message)
 015            : this(message, null, null)
 16        {
 017        }
 18        public MessageHeaderException(string message, bool isDuplicate)
 019            : this(message, null, null)
 20        {
 021        }
 22        public MessageHeaderException(string message, Exception innerException)
 023            : this(message, null, null, innerException)
 24        {
 025        }
 26        public MessageHeaderException(string message, string headerName, string ns)
 027            : this(message, headerName, ns, null)
 28        {
 029        }
 30        public MessageHeaderException(string message, string headerName, string ns, bool isDuplicate)
 031            : this(message, headerName, ns, isDuplicate, null)
 32        {
 033        }
 34        public MessageHeaderException(string message, string headerName, string ns, Exception innerException)
 035            : this(message, headerName, ns, false, innerException)
 36        {
 037        }
 38        public MessageHeaderException(string message, string headerName, string ns, bool isDuplicate, Exception innerExc
 039            : base(message, innerException)
 40        {
 041            HeaderName = headerName;
 042            HeaderNamespace = ns;
 043            IsDuplicate = isDuplicate;
 044        }
 45
 046        public string HeaderName { get; }
 47
 048        public string HeaderNamespace { get; }
 49
 50        // IsDuplicate==true means there was more than one; IsDuplicate==false means there were zero
 051        public bool IsDuplicate { get; }
 052        public StreamingContext Context { get; }
 53
 54        internal Message ProvideFault(MessageVersion messageVersion)
 55        {
 56            Fx.Assert(messageVersion.Addressing == AddressingVersion.WSAddressing10, "");
 057            WSAddressing10ProblemHeaderQNameFault phf = new WSAddressing10ProblemHeaderQNameFault(this);
 058            Message message = Channels.Message.CreateMessage(messageVersion, phf, AddressingVersion.WSAddressing10.Fault
 059            phf.AddHeaders(message.Headers);
 060            return message;
 61        }
 62
 63        // for serialization
 064        public MessageHeaderException() { }
 065        protected MessageHeaderException(SerializationInfo info, StreamingContext context) : base(info, context)
 66        {
 067            Context = context;
 068        }
 69    }
 70}