< Summary

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

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\DIalect\HeaderPropertyParser.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 HeaderPropertyParser : PropertyParserBase<DialectDescriptor>, IPropertyParser<DialectDescriptor>
 9    {
 110        public HeaderPropertyParser(List<Warning> warnings, DialectDescriptor descriptor) : base(warnings, descriptor)
 11        {
 112        }
 13
 14        public void ParseProperty(JProperty property)
 15        {
 116            if (property.Value.Type != JTokenType.Boolean)
 17            {
 118                Warnings.Add(WarningFactory.GetAtomicPropertyBoolWrongValueWarning(property.Value, property.Name, proper
 119                Descriptor.header = new AtomicPropertyBoolean(true);
 120                if (Descriptor.headerRowCount!.IsDefault) Descriptor.headerRowCount = new AtomicPropertyInteger(1);
 21            }
 22            else
 23            {
 124                bool boolValue = (bool)property.Value;
 125                Descriptor.header = new AtomicPropertyBoolean(boolValue);
 126                if (Descriptor.headerRowCount!.IsDefault)
 127                    Descriptor.headerRowCount = new AtomicPropertyInteger(boolValue ? 1 : 0);
 28            }
 29
 130        }
 31    }
 32}