< Summary

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

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\InheritedProperties\SeparatorPropertyParser.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.InheritedProperties
 7{
 8    internal class SeparatorPropertyParser : PropertyParserBase<InheritedPropertiesDescriptor>, IPropertyParser<Inherite
 9    {
 110        public SeparatorPropertyParser(List<Warning> warnings, InheritedPropertiesDescriptor descriptor) : base(warnings
 11        {
 112        }
 13
 14        public void ParseProperty(JProperty property)
 15        {
 116            if (property.Value.Type == JTokenType.String)
 17            {
 118                Descriptor.separator = new AtomicPropertyString(property.Value.ToString());
 19            }
 20            else
 21            {
 122                if (property.Value.Type != JTokenType.Null)
 123                    Warnings.Add(WarningFactory.GetSeparatorInvalidValueWarning(property.Value.ToString()));
 124                Descriptor.separator = new AtomicPropertyString(null);
 25
 26            }
 127        }
 28    }
 29}