< Summary

Information
Class: ValidateLib.Metadata.PropertyParsers.DIalect.SkipInitialSpacePropertyParser
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\DIalect\SkipInitialSpacePropertyParser.cs
Line coverage
90%
Covered lines: 10
Uncovered lines: 1
Coverable lines: 11
Total lines: 31
Line coverage: 90.9%
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
SkipInitialSpacePropertyParser(...)20
ParseProperty(...)2610

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\DIalect\SkipInitialSpacePropertyParser.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 SkipInitialSpacePropertyParser : PropertyParserBase<DialectDescriptor>, IPropertyParser<DialectDescri
 9    {
 110        public SkipInitialSpacePropertyParser(List<Warning> warnings, DialectDescriptor descriptor) : base(warnings, des
 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.skipInitialSpace = new AtomicPropertyBoolean(false);
 120                if (Descriptor.trim is null) Descriptor.trim = new AtomicPropertyString("false");
 21            }
 22            else
 23            {
 124                bool boolValue = (bool)property.Value;
 125                Descriptor.skipInitialSpace = new AtomicPropertyBoolean(boolValue);
 126                if (Descriptor.trim is null)
 027                    Descriptor.trim = new AtomicPropertyString(boolValue ? "start" : "false");
 28            }
 129        }
 30    }
 31}