< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Dispatcher.FaultContractInfo
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Dispatcher/FaultContractInfo.cs
Line coverage
100%
Covered lines: 20
Uncovered lines: 0
Coverable lines: 20
Total lines: 61
Line coverage: 100%
Branch coverage
75%
Covered branches: 9
Total branches: 12
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%11100%
.ctor(...)66.66%66100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Dispatcher/FaultContractInfo.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.Collections.Generic;
 6using System.Runtime.Serialization;
 7using CoreWCF.Description;
 8
 9namespace CoreWCF.Dispatcher
 10{
 11    public class FaultContractInfo
 12    {
 13        private DataContractSerializer _serializer;
 14
 15        public FaultContractInfo(string action, Type detail)
 367616            : this(action, detail, null, null, null)
 17        {
 367618        }
 383819        internal FaultContractInfo(string action, Type detail, XmlName elementName, string ns, IList<Type> knownTypes)
 20        {
 383821            Action = action ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(action));
 383822            Detail = detail ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(detail));
 383823            if (elementName != null)
 24            {
 3025                ElementName = elementName.EncodedName;
 26            }
 27
 383828            ElementNamespace = ns;
 383829            KnownTypes = knownTypes;
 383830        }
 31
 55732        public string Action { get; }
 33
 21134        public Type Detail { get; }
 35
 9136        internal string ElementName { get; }
 37
 3038        internal string ElementNamespace { get; }
 39
 6140        internal IList<Type> KnownTypes { get; }
 41
 42        internal DataContractSerializer Serializer
 43        {
 44            get
 45            {
 6546                if (_serializer == null)
 47                {
 6148                    if (ElementName == null)
 49                    {
 3150                        _serializer = DataContractSerializerDefaults.CreateSerializer(Detail, KnownTypes, int.MaxValue /
 51                    }
 52                    else
 53                    {
 3054                        _serializer = DataContractSerializerDefaults.CreateSerializer(Detail, KnownTypes, ElementName, E
 55                    }
 56                }
 6557                return _serializer;
 58            }
 59        }
 60    }
 61}