< Summary

Information
Class: ValidateLib.Metadata.PropertyParsers.Table.UrlPropertyParser
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\Table\UrlPropertyParser.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 24
Line coverage: 100%
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

MethodBlocks covered Blocks not covered
UrlPropertyParser(...)20
ParseProperty(...)110

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\Table\UrlPropertyParser.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Descriptors;
 4using ValidateLib.Metadata.Parsers;
 5using ValidateLib.Metadata.Properties;
 6
 7namespace ValidateLib.Metadata.PropertyParsers.Table
 8{
 9    public class UrlPropertyParser : PropertyParserBase<TableDescriptor>, IPropertyParser<TableDescriptor>
 10    {
 111        public UrlPropertyParser(List<Warning> warnings, TableDescriptor descriptor) : base(warnings, descriptor)
 12        {
 113        }
 14
 15        public void ParseProperty(JProperty property)
 16        {
 117            var linkPropertyParser = new LinkPropertyParser(Warnings);
 118            var urlValue = linkPropertyParser.ParseJToken(property.Value, property.Name);
 119            if (urlValue == null) urlValue = new LinkProperty("");
 120            Descriptor.url = urlValue;
 21
 122        }
 23    }
 24}