< Summary

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

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\InheritedProperties\DatatypePropertyParser.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Descriptors;
 4using ValidateLib.Metadata.Parsers;
 5using ValidateLib.Metadata.Properties.AtomicProperties;
 6using ValidateLib.Metadata.Validators;
 7
 8namespace ValidateLib.Metadata.PropertyParsers.InheritedProperties
 9{
 10    internal class DatatypePropertyParser : PropertyParserBase<InheritedPropertiesDescriptor>, IPropertyParser<Inherited
 11    {
 112        public DatatypePropertyParser(List<Warning> warnings, InheritedPropertiesDescriptor? descriptor = null) : base(w
 13        {
 114        }
 15
 16        public void ParseProperty(JProperty property)
 17        {
 118            var datatypeParser = new DatatypeParser(Warnings);
 119            var datatypePropertyValue = datatypeParser.ParseJToken(property.Value, property.Name);
 120            if (!datatypePropertyValue.IsInvalid)
 21            {
 122                DatatypeValidator datatypeValidator = new DatatypeValidator();
 123                Descriptor.datatype = new AtomicProperty<DatatypeDescriptor>(datatypePropertyValue);
 124                Warnings.AddRange(datatypeValidator.Validate(Descriptor));
 25            }
 26
 27
 128        }
 29    }
 30}