< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.ActionMismatchAddressingException
Assembly: CoreWCF.Http
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Http/src/CoreWCF/ActionMismatchAddressingException.cs
Line coverage
33%
Covered lines: 4
Uncovered lines: 8
Coverable lines: 12
Total lines: 54
Line coverage: 33.3%
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%11100%
.ctor(...)100%110%
ProvideFault(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Http/src/CoreWCF/ActionMismatchAddressingException.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    internal class ActionMismatchAddressingException : ProtocolException
 13    {
 14        private readonly string _httpActionHeader;
 15        private readonly string _soapActionHeader;
 16
 17        public ActionMismatchAddressingException(string message, string soapActionHeader, string httpActionHeader)
 118            : base(message)
 19        {
 120            _httpActionHeader = httpActionHeader;
 121            _soapActionHeader = soapActionHeader;
 122        }
 23
 24        protected ActionMismatchAddressingException(SerializationInfo info, StreamingContext context)
 025            : base(info, context)
 26        {
 027        }
 28
 29        public string HttpActionHeader
 30        {
 31            get
 32            {
 033                return _httpActionHeader;
 34            }
 35        }
 36
 37        public string SoapActionHeader
 38        {
 39            get
 40            {
 041                return _soapActionHeader;
 42            }
 43        }
 44
 45        internal Message ProvideFault(MessageVersion messageVersion)
 46        {
 47            Fx.Assert(messageVersion.Addressing == AddressingVersion.WSAddressing10, "");
 048            WSAddressing10ProblemHeaderQNameFault phf = new WSAddressing10ProblemHeaderQNameFault(this);
 049            Message message = Channels.Message.CreateMessage(messageVersion, phf, messageVersion.Addressing.FaultAction)
 050            phf.AddHeaders(message.Headers);
 051            return message;
 52        }
 53    }
 54}