< Summary

Information
Class: ValidateLib.Metadata.PropertyParsers.DIalect.HeaderRowCountPropertyParser
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\DIalect\HeaderRowCountPropertyParser.cs
Line coverage
75%
Covered lines: 6
Uncovered lines: 2
Coverable lines: 8
Total lines: 31
Line coverage: 75%
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
HeaderRowCountPropertyParser(...)20
ParseProperty(...)214

File(s)

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

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Descriptors;
 4using ValidateLib.Metadata.Properties.AtomicProperties;
 5
 6namespace ValidateLib.Metadata.PropertyParsers.DIalect
 7{
 8    internal class HeaderRowCountPropertyParser : PropertyParserBase<DialectDescriptor>, IPropertyParser<DialectDescript
 9    {
 110        public HeaderRowCountPropertyParser(List<Warning> warnings, DialectDescriptor descriptor) : base(warnings, descr
 11        {
 112        }
 13
 14        public void ParseProperty(JProperty property)
 15        {
 116            if (property.Value.Type != JTokenType.Integer)
 17            {
 118                Warnings.Add(WarningFactory.GetAtomicIntegerWrongValueWarning(property.Value, property.Name, property.Va
 19            }
 20            else
 21            {
 122                if ((int)property.Value >= 0)
 123                    Descriptor.headerRowCount = new AtomicPropertyInteger((int)property.Value);
 24                else
 025                    Descriptor.headerRowCount = new AtomicPropertyInteger(1);
 26            }
 27
 28
 029        }
 30    }
 31}