< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Description.MetadataLocation
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/MetadataLocation.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 40
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
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%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/MetadataLocation.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.Xml;
 6using System.Xml.Serialization;
 7
 8namespace CoreWCF.Description
 9{
 10    [XmlRoot(ElementName = MetadataStrings.MetadataExchangeStrings.Location, Namespace = MetadataStrings.MetadataExchang
 11    public class MetadataLocation
 12    {
 13        private string _location;
 14
 015        public MetadataLocation()
 16        {
 017        }
 18
 019        public MetadataLocation(string location)
 20        {
 021            Location = location;
 022        }
 23
 24        [XmlText]
 25        public string Location
 26        {
 027            get { return _location; }
 28            set
 29            {
 030                if (value != null)
 31                {
 032                    if (!Uri.TryCreate(value, UriKind.RelativeOrAbsolute, out _))
 033                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.Format(SR.SFxMetadataReferenceIn
 34                }
 35
 036                _location = value;
 037            }
 38        }
 39    }
 40}