< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.FaultReasonText
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/FaultReasonText.cs
Line coverage
89%
Covered lines: 17
Uncovered lines: 2
Coverable lines: 19
Total lines: 48
Line coverage: 89.4%
Branch coverage
50%
Covered branches: 6
Total branches: 12
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%
.ctor(...)50%44100%
.ctor(...)50%4483.33%
Matches(...)50%2266.66%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/FaultReasonText.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.Globalization;
 5
 6namespace CoreWCF
 7{
 8    public class FaultReasonText
 9    {
 24210        public FaultReasonText(string text)
 11        {
 24212            Text = text ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(text));
 24213            XmlLang = CultureInfo.CurrentCulture.Name;
 24214        }
 15
 18416        public FaultReasonText(string text, string xmlLang)
 17        {
 18418            Text = text ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(text));
 18419            XmlLang = xmlLang ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(xmlLang));
 18420        }
 21
 22        // public on full framework
 6923        internal FaultReasonText(string text, CultureInfo cultureInfo)
 24        {
 6925            if (cultureInfo == null)
 26            {
 027                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(cultureInfo));
 28            }
 29
 6930            Text = text ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(text));
 6931            XmlLang = cultureInfo.Name;
 6932        }
 33
 34        public bool Matches(CultureInfo cultureInfo)
 35        {
 836            if (cultureInfo == null)
 37            {
 038                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(cultureInfo));
 39            }
 40
 841            return XmlLang == cultureInfo.Name;
 42        }
 43
 42744        public string XmlLang { get; }
 45
 47146        public string Text { get; }
 47    }
 48}