< Summary

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

File(s)

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

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Descriptors;
 4using ValidateLib.UtilityClasses;
 5
 6namespace ValidateLib.Metadata.PropertyParsers.Column
 7{
 8    internal class NamePropertyParser : PropertyParserBase<ColumnDescriptor>, IPropertyParser<ColumnDescriptor>
 9    {
 110        public NamePropertyParser(List<Warning> warnings, ColumnDescriptor? descriptor = null) : base(warnings, descript
 11        {
 112        }
 13
 14        public void ParseProperty(JProperty property)
 15        {
 116            if (property.Value.Type != JTokenType.String)
 17            {
 118                Warnings.Add(WarningFactory.GetStringPropertyWrongValueWarning(property.Value, property.Name, property.V
 119                return;
 20            }
 21            else
 22            {
 123                if (!ColumnUtilityClass.IsValidColumnName(property.Value.ToString()) || property.Value.ToString().Starts
 124                    Warnings.Add(WarningFactory.GetWrongColumnNameWarning(property.Value.ToString()));
 25                else
 126                    Descriptor.name = new Properties.AtomicProperties.AtomicPropertyString(property.Value.ToString());
 27            }
 128        }
 29    }
 30}