< Summary

Information
Class: ValidateLib.Metadata.Parsers.UriTemplatePropertyParser
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\Parsers\UriTemplatePropertyParser.cs
Line coverage
80%
Covered lines: 8
Uncovered lines: 2
Coverable lines: 10
Total lines: 33
Line coverage: 80%
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
UriTemplatePropertyParser(...)30
ParseJToken(...)02
ParseJToken(...)100

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\Parsers\UriTemplatePropertyParser.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Properties;
 4
 5namespace ValidateLib.Metadata.Parsers
 6{
 7    internal class UriTemplatePropertyParser
 8    {
 09        public URITemplateProperty? Descriptor { get; set; }
 110        public List<Warning> Warnings { get; set; }
 111        public UriTemplatePropertyParser(List<Warning> warnings)
 12        {
 113            Warnings = warnings;
 114        }
 15        public URITemplateProperty ParseJToken(JToken jToken)
 16        {
 017            throw new NotImplementedException();
 18        }
 19        public URITemplateProperty ParseJToken(JToken jToken, string defaultValue, string propertyName)
 20        {
 121            if (jToken.Type != JTokenType.String)
 22            {
 123                Warnings.Add(WarningFactory.GetURITemplateWrongValueWarning(jToken, propertyName));
 124                return new URITemplateProperty(defaultValue);
 25            }
 26            else
 27            {
 128                return new URITemplateProperty(jToken.ToString());
 29            }
 30        }
 31
 32    }
 33}