< Summary

Information
Class: ValidateLib.Metadata.PropertyParsers.DataType.Format.PatternPropertyParser
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\DataType\Format\PatternPropertyParser.cs
Line coverage
66%
Covered lines: 4
Uncovered lines: 2
Coverable lines: 6
Total lines: 25
Line coverage: 66.6%
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
PatternPropertyParser(...)20
ParseProperty(...)89

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\PropertyParsers\DataType\Format\PatternPropertyParser.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Descriptors;
 4
 5namespace ValidateLib.Metadata.PropertyParsers.DataType.Format
 6{
 7    internal class PatternPropertyParser : PropertyParserBase<FormatDescriptor>, IPropertyParser<FormatDescriptor>
 8    {
 19        public PatternPropertyParser(List<Warning> warnings, FormatDescriptor? descriptor = null) : base(warnings, descr
 10        {
 111        }
 12
 13        public void ParseProperty(JProperty property)
 14        {
 115            if (property.Value.Type == JTokenType.String)
 16            {
 117                Descriptor.pattern = property.Value.ToString();
 18            }
 19            else
 20            {
 021                Warnings.Add(WarningFactory.GetStringPropertyWrongValueWarning(property.Value, property.Name, property.V
 22            }
 023        }
 24    }
 25}