< Summary

Information
Class: ValidateLib.Metadata.Descriptors.ContextDescriptor
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\Descriptors\ContextDescriptor.cs
Line coverage
77%
Covered lines: 7
Uncovered lines: 2
Coverable lines: 9
Total lines: 44
Line coverage: 77.7%
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
NormalizeProperty(...)70
GetParser(...)02
GetPropertyParser(...)52

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\Descriptors\ContextDescriptor.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Parsers;
 4using ValidateLib.Metadata.PropertyParsers;
 5using ValidateLib.Metadata.PropertyParsers.Context;
 6
 7namespace ValidateLib.Metadata.Descriptors
 8{
 9    public class ContextDescriptor : Descriptor, Interfaces.IParsable<ContextDescriptor>
 10    {
 111        public Context? context { get; set; }
 12
 13        new public static List<Warning> NormalizeProperty(JProperty property, Context context)
 14        {
 115            List<Warning> warnings = new List<Warning>();
 116            switch (property.Name)
 17            {
 18                case "@context":
 119                    return warnings;
 20                default:
 121                    return Descriptor.NormalizeProperty(property, context);
 22
 23            }
 24        }
 25
 26        public static IParser<ContextDescriptor> GetParser(List<Warning> warnings, ContextDescriptor? descriptor = null)
 27        {
 028            throw new NotImplementedException();
 29        }
 30
 31        new public IPropertyParserBase? GetPropertyParser(JProperty property, List<Warning> warnings)
 32        {
 133            string propertyName = property.Name;
 34            switch (propertyName)
 35            {
 36                case "@context":
 037                    return new ContextPropertyParser(warnings, this);
 38                default:
 139                    return ((Descriptor)this).GetPropertyParser(property, warnings);
 40
 41            }
 42        }
 43    }
 44}