< Summary

Information
Class: ValidateLib.Metadata.PropertyParsers.CommonPropertyParser
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\CommonPropertyParser.cs
Line coverage
80%
Covered lines: 8
Uncovered lines: 2
Coverable lines: 10
Total lines: 32
Line coverage: 80%
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
CommonPropertyParser(...)20
ParseProperty(...)146

File(s)

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

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Descriptors;
 4using ValidateLib.Metadata.Properties;
 5using ValidateLib.Metadata.Validators;
 6
 7namespace ValidateLib.Metadata.PropertyParsers
 8{
 9
 10    public class CommonPropertyParser : PropertyParserBase<CommonPropertiesDescriptor>, IPropertyParser<CommonProperties
 11    {
 112        public CommonPropertyParser(List<Warning> warnings, CommonPropertiesDescriptor descriptor) : base(warnings, desc
 13        {
 114        }
 15        public void ParseProperty(JProperty property)
 16        {
 117            if (property.Value.Type != JTokenType.Object && property.Value.Type != JTokenType.Array)
 18            {
 019                Warnings.Add(
 020                    WarningFactory.GetCommonPropertyWrongValueWarning(property.Value, property.Name));
 21            }
 22            else
 23            {
 124                var commonProperty = new CommonProperty(property.Name, property.Value);
 125                CommonPropertyValidator commonPropertyValidator = new CommonPropertyValidator(commonProperty);
 126                commonPropertyValidator.Validate(commonProperty);
 127                Descriptor.commonProperties.Add(commonProperty);
 28
 29            }
 130        }
 31    }
 32}