< Summary

Information
Class: ValidateLib.Metadata.PropertyParsers.ForeignKey.ReferencePropertyParser
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\ForeignKey\ReferencePropertyParser.cs
Line coverage
87%
Covered lines: 7
Uncovered lines: 1
Coverable lines: 8
Total lines: 28
Line coverage: 87.5%
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
ReferencePropertyParser(...)20
ParseProperty(...)181

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\ForeignKey\ReferencePropertyParser.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.ForeignKey
 8{
 9    internal class ReferencePropertyParser : PropertyParserBase<ForeignKeyDescriptor>, IPropertyParser<ForeignKeyDescrip
 10    {
 111        public ReferencePropertyParser(List<Warning> warnings, ForeignKeyDescriptor descriptor) : base(warnings, descrip
 12        {
 113        }
 14
 15        public void ParseProperty(JProperty property)
 16        {
 117            var referenceParser = new ReferenceParser(Warnings);
 118            var referencePropertyDescriptor = referenceParser.ParseJToken(property.Value, property.Name);
 119            if (!referencePropertyDescriptor.IsInvalid) Descriptor.reference = new ObjectProperty<ReferenceDescriptor>(r
 20            else
 21            {
 122                Descriptor.reference = new ObjectProperty<ReferenceDescriptor>(new ReferenceDescriptor());
 123                Descriptor.reference._value.CheckRequiredPropertiesPresent();
 24            }
 25
 026        }
 27    }
 28}