< Summary

Information
Class: ValidateLib.Metadata.PropertyParsers.DescriptorNS.IdPropertyParser
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\Descriptor\IdPropertyParser.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 27
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
IdPropertyParser(...)20
ParseProperty(...)210

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\Descriptor\IdPropertyParser.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Errors;
 3using ValidateLib.ErrorsAndWarnings.Warnings;
 4using ValidateLib.Metadata.Descriptors;
 5using ValidateLib.Metadata.Parsers;
 6using ValidateLib.Metadata.Properties;
 7
 8
 9namespace ValidateLib.Metadata.PropertyParsers.DescriptorNS
 10{
 11    public class IdPropertyParser : PropertyParserBase<Descriptor>, IPropertyParser<Descriptor>
 12    {
 113        public IdPropertyParser(List<Warning> warnings, Descriptor descriptor) : base(warnings, descriptor)
 14        {
 115        }
 16
 17        public void ParseProperty(JProperty property)
 18        {
 19
 120            if (property.Value.Type == JTokenType.String && property.Value.ToString().StartsWith("_:")) ErrorFactory.Thr
 121            var linkPropertyParser = new LinkPropertyParser(Warnings);
 122            var idValue = linkPropertyParser.ParseJToken(property.Value, property.Name);
 123            if (idValue == null) Descriptor.id = new LinkProperty("");
 124            else Descriptor.id = idValue;
 125        }
 26    }
 27}