< Summary

Information
Class: ValidateLib.Metadata.Descriptors.TopLevelObjectDescriptor
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\Metadata\Descriptors\TopLevelObjectDescriptor.cs
Line coverage
96%
Covered lines: 24
Uncovered lines: 1
Coverable lines: 25
Total lines: 73
Line coverage: 96%
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

File(s)

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

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Warnings;
 3using ValidateLib.Metadata.Descriptors.Interfaces;
 4using ValidateLib.Metadata.Parsers;
 5using ValidateLib.Metadata.Properties;
 6using ValidateLib.Metadata.Properties.AtomicProperties;
 7using ValidateLib.Metadata.PropertyParsers;
 8using ValidateLib.Metadata.PropertyParsers.TopLevelObject;
 9
 10namespace ValidateLib.Metadata.Descriptors
 11{
 12    public class TopLevelObjectDescriptor : InheritedPropertiesDescriptor, IRequiredPropertyValidatable, Interfaces.IPar
 13    {
 114        public ObjectProperty<DialectDescriptor>? dialect { get; set; }
 115        public ArrayProperty<NoteDescriptor>? notes { get; set; }
 116        public AtomicPropertyString tableDirection { get; set; } = new AtomicPropertyString("auto") { IsDefault = true }
 117        public ObjectProperty<SchemaDescriptor>? tableSchema { get; set; }
 118        public ArrayProperty<TransformationDescriptor>? transformations { get; set; }
 19
 20        public List<Warning> CheckRequiredPropertiesPresent()
 21        {
 122            List<Warning> errors = new List<Warning>();
 123            return errors;
 24        }
 25
 26        new public static List<Warning> NormalizeProperty(JProperty property, Context context)
 27        {
 128            List<Warning> errors = new List<Warning>();
 129            if (CommonProperty.IsCommonProperty(property.Name)) CommonProperty.Normalize(property.Value, context, proper
 130            switch (property.Name)
 31            {
 32                case "dialect":
 133                    return ObjectProperty<DialectDescriptor>.Normalize(property.Value, context, property);
 34                case "notes":
 135                    return CommonProperty.Normalize(property.Value, context, property);
 36                case "tableDirection":
 137                    return errors;
 38                case "tableSchema":
 139                    return ObjectProperty<SchemaDescriptor>.Normalize(property.Value, context);
 40                case "transformations":
 141                    return ArrayProperty<TransformationDescriptor>
 142                        .Normalize<TransformationDescriptor>(property.Value, context, property);
 43                default:
 144                    return InheritedPropertiesDescriptor.NormalizeProperty(property, context);
 45            }
 46        }
 47        new public IPropertyParserBase? GetPropertyParser(JProperty property, List<Warning> warnings)
 48        {
 149            switch (property.Name)
 50            {
 51                case "dialect":
 152                    return new DialectPropertyParser(warnings, this);
 53                case "notes":
 154                    return new NotesPropertyParser(warnings, this);
 55                case "tableDirection":
 156                    return new TableDirectionPropertyParser(warnings, this);
 57                case "tableSchema":
 158                    return new TableSchemaPropertyParser(warnings, this);
 59                case "transformations":
 160                    return new TransformationsPropertyParser(warnings, this);
 61                default:
 162                    return ((InheritedPropertiesDescriptor)this).GetPropertyParser(property, warnings);
 63
 64            }
 65        }
 66
 67        public static IParser<TopLevelObjectDescriptor> GetParser(List<Warning> warnings, TopLevelObjectDescriptor? desc
 68        {
 069            throw new NotImplementedException();
 70        }
 71
 72    }
 73}