< Summary

Information
Class: ValidateLib.ErrorsAndWarnings.Errors.ErrorFactory
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\ErrorsAndWarnings\Errors\ErrorFactory.cs
Line coverage
78%
Covered lines: 97
Uncovered lines: 27
Coverable lines: 124
Total lines: 307
Line coverage: 78.2%
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
ThrowWrongTypeOfTopLevelObjectError(...)03
ThrowZeroTablesInTablesError(...)30
ThrowRequiredPropertyMissingError(...)30
ThrowInvalidIDPropertyError(...)30
ThrowInvalidTypePropertyError(...)30
ThrowIdenticalColumnNamesError(...)30
ThrowVirtualColumnPrecedesNonVirtualError(...)30
ThrowResourceAndSchemaReferencePresentError(...)03
ThrowReferencingColumnDoesNotExistError(...)30
ThrowTwoSatisfyingReferencedTablesErrorError(...)03
ThrowNoSatisfyingReferencedTableError(...)30
ThrowReferencedColumnDoesNotExistError(...)30
ThrowCommonPropertyValueErrorError(...)30
ThrowCommonPropertyValueErrorError(...)30
ThrowCPInvalidValueTypeError(...)02
ThrowDatatypeLengthConstraintError(...)30
ThrowDatatypeValueConstraintError(...)30
ThrowDatatypeValidationError(...)30
ThrowInvalidFormatError(...)30
ThrowLengthConstraintOnInvalidDatatypeBaseError(...)30
ThrowValueConstraintOnInvalidDatatypeBaseError(...)30
ThrowInvalidPropertyOnFKDescriptorError(...)30
ThrowInvalidPropertyOnContextDescriptorError(...)30
ThrowMetadataFileCouldNotBeLoadedError(...)03
GetMetadataFileCouldNotBeLoadedError(...)30
GetUnknownError(...)30
GetUserMetadataTablesIrisMismatchMetdataError(...)03
ThrowTitleNotCompatibleWithLangError(...)20
GetWrongNumberOfTabularIRIsProvidedError(...)02
ThrowMissingContextError(...)02
ThrowInvalidContextValueError(...)02
ThrowRemoteFileResoltuionError(...)20
ThrowUnsupportedSchemeError(...)02
GetColumnsCountMismatchValidationError(...)20
GetDuplicateInPKValidationError(...)20
GetDuplicateInFKReferencedColumnsValidationError(...)20
GetNotAllReferencedValuesExistValidationError(...)20
GetEmptyCellInRequiredColumnVE(...)20
GetCouldNotOpenFileVE(...)02
GetTableSchemesNotCompatibleError(...)20
GetDatatypeLengthConstraintVE(...)20
GetDatatypeValueConstraintVE(...)20
GetCharOutsideQuotesVE(...)02

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\ErrorsAndWarnings\Errors\ErrorFactory.cs

#LineLine coverage
 1using Newtonsoft.Json.Linq;
 2using ValidateLib.ErrorsAndWarnings.Errors.Specific;
 3using ValidateLib.ErrorsAndWarnings.Errors.ValidationErrors;
 4using ValidateLib.Metadata.Descriptors;
 5using ValidateLib.Metadata.Properties;
 6using ValidateLib.TabularData.AnnotatedTabularDataModel;
 7
 8namespace ValidateLib.ErrorsAndWarnings.Errors
 9{
 10    public class ErrorFactory
 11    {
 12        public static void ThrowWrongTypeOfTopLevelObjectError(string? additionalInfo = null)
 13        {
 014            throw new Error()
 015            {
 016                AdditionalInfo = additionalInfo
 017            };
 18        }
 19
 20        public static void ThrowZeroTablesInTablesError(string? additionalInfo = null)
 21        {
 122            throw new ZeroTablesInTablesError()
 123            {
 124                AdditionalInfo = additionalInfo
 125            };
 26        }
 27
 28        public static void ThrowRequiredPropertyMissingError(string missingPropertyName, string descriptorName, string? 
 29        {
 130            throw new RequiredPropertyMissingError(missingPropertyName, descriptorName)
 131            {
 132                AdditionalInfo = additionalInfo
 133            };
 34        }
 35
 36        public static void ThrowInvalidIDPropertyError(string invalidID, string? additionalInfo = null)
 37        {
 138            throw new InvalidIDPropertyError(invalidID)
 139            {
 140                AdditionalInfo = additionalInfo
 141            };
 42        }
 43        public static void ThrowInvalidTypePropertyError(string InvalidProperty, string expectedType, string? additional
 44        {
 145            throw new InvalidTypePropertyError(InvalidProperty, expectedType)
 146            {
 147                AdditionalInfo = additionalInfo
 148            };
 49        }
 50
 51        public static void ThrowIdenticalColumnNamesError(string identicalName, string? additionalInfo = null)
 52        {
 153            throw new IdenticalColumnNamesError(identicalName)
 154            {
 155                AdditionalInfo = additionalInfo
 156            };
 57        }
 58
 59        public static void ThrowVirtualColumnPrecedesNonVirtualError(int index, int indexOfFirstVirtual, string? additio
 60        {
 161            throw new VirtualColumnPrecedesNonVirtualError(index, indexOfFirstVirtual)
 162            {
 163                AdditionalInfo = additionalInfo
 164            };
 65        }
 66
 67        public static void ThrowResourceAndSchemaReferencePresentError(string? additionalInfo = null)
 68        {
 069            throw new ResourceAndSchemaReferencePresentError()
 070            {
 071                AdditionalInfo = additionalInfo
 072            };
 73        }
 74
 75        public static void ThrowReferencingColumnDoesNotExistError(TableDescriptor table, ForeignKeyDescriptor fkdesc, s
 76        {
 177            throw new ReferencingColumnDoesNotExistError(table, fkdesc)
 178            {
 179                AdditionalInfo = additionalInfo
 180            };
 81        }
 82
 83        public static void ThrowTwoSatisfyingReferencedTablesErrorError(TableDescriptor table, ForeignKeyDescriptor fkDe
 84        {
 085            throw new TwoSatisfyingReferencedTablesError(table, fkDesc)
 086            {
 087                AdditionalInfo = additionalInfo
 088            };
 89        }
 90
 91        public static void ThrowNoSatisfyingReferencedTableError(TableDescriptor table, ForeignKeyDescriptor fkdesc, str
 92        {
 193            throw new NoSatisfyingReferencedTableError(table, fkdesc)
 194            {
 195                AdditionalInfo = additionalInfo
 196            };
 97        }
 98
 99
 100
 101        public static void ThrowReferencedColumnDoesNotExistError(TableDescriptor table, ForeignKeyDescriptor fkdesc, st
 102        {
 1103            throw new ReferencedColumnDoesNotExistError(table, fkdesc)
 1104            {
 1105                AdditionalInfo = additionalInfo
 1106            };
 107        }
 108
 109        public static void ThrowCommonPropertyValueErrorError(CommonProperty commonproperty, string? additionalInfo = nu
 110        {
 1111            throw new CommonPropertyValueError(commonproperty)
 1112            {
 1113                AdditionalInfo = additionalInfo
 1114            };
 115        }
 116
 117        public static void ThrowCommonPropertyValueErrorError(JProperty jprop, string? additionalInfo = null)
 118        {
 1119            throw new CommonPropertyValueError(jprop)
 1120            {
 1121                AdditionalInfo = additionalInfo
 1122            };
 123        }
 124
 125        public static void ThrowCPInvalidValueTypeError(JObject commonPropertyObject)
 126        {
 0127            throw new CPInvalidValueTypeError(commonPropertyObject);
 128        }
 129        public static void ThrowDatatypeLengthConstraintError(string? additionalInfo = null)
 130        {
 1131            throw new DatatypeLengthConstraintError()
 1132            {
 1133                AdditionalInfo = additionalInfo
 1134            };
 135        }
 136        public static void ThrowDatatypeValueConstraintError(string? additionalInfo = null)
 137        {
 1138            throw new DatatypeValueConstraintError()
 1139            {
 1140                AdditionalInfo = additionalInfo
 1141            };
 142        }
 143
 144        public static void ThrowDatatypeValidationError(string? additionalInfo = null)
 145        {
 1146            throw new DatatypeValidationError()
 1147            {
 1148                AdditionalInfo = additionalInfo
 1149            };
 150        }
 151
 152        public static void ThrowInvalidFormatError(string invalidFormat, string? additionalInfo = null)
 153        {
 1154            throw new InvalidFormatError(invalidFormat)
 1155            {
 1156                AdditionalInfo = additionalInfo
 1157            };
 158        }
 159        public static void ThrowLengthConstraintOnInvalidDatatypeBaseError(string invalidBase, string? additionalInfo = 
 160        {
 1161            throw new LengthConstraintOnInvalidDatatypeBaseError(invalidBase)
 1162            {
 1163                AdditionalInfo = additionalInfo
 1164            };
 165        }
 166
 167
 168        public static void ThrowValueConstraintOnInvalidDatatypeBaseError(string invalidBase, string? additionalInfo = n
 169        {
 1170            throw new ValueConstraintOnInvalidDatatypeBaseError(invalidBase)
 1171            {
 1172                AdditionalInfo = additionalInfo
 1173            };
 174        }
 175
 176
 177        public static void ThrowInvalidPropertyOnFKDescriptorError(string invalidProp, string? additionalInfo = null)
 178        {
 1179            throw new InvalidPropertyOnFKDescriptorError(invalidProp)
 1180            {
 1181                AdditionalInfo = additionalInfo
 1182            };
 183        }
 184        public static void ThrowInvalidPropertyOnContextDescriptorError(string invalidProperty, string? additionalInfo =
 185        {
 1186            throw new InvalidPropertyOnContextDescriptorError(invalidProperty)
 1187            {
 1188                AdditionalInfo = additionalInfo
 1189            };
 190        }
 191
 192        public static void ThrowMetadataFileCouldNotBeLoadedError(string metadataIRI, string? additionalInfo = null)
 193        {
 0194            throw new MetadataFileCouldNotBeLoadedError(metadataIRI)
 0195            {
 0196                AdditionalInfo = additionalInfo
 0197            };
 198        }
 199
 200        public static MetadataFileCouldNotBeLoadedError GetMetadataFileCouldNotBeLoadedError(string metadataIRI, string?
 201        {
 1202            return new MetadataFileCouldNotBeLoadedError(metadataIRI)
 1203            {
 1204                AdditionalInfo = additionalInfo
 1205            };
 206        }
 207
 208        public static Error GetUnknownError(string? additionalInfo = null)
 209        {
 1210            return new UnknownError()
 1211            {
 1212                AdditionalInfo = additionalInfo
 1213            };
 214        }
 215
 216        public static Error GetUserMetadataTablesIrisMismatchMetdataError(int numberOfIrisUser, int numberOfTables, stri
 217        {
 0218            return new UserMetadataTablesIrisMismatchMetdataError(numberOfIrisUser, numberOfTables)
 0219            {
 0220                AdditionalInfo = additionalInfo,
 0221            };
 222        }
 223
 224        public static void ThrowTitleNotCompatibleWithLangError(string incompatibleTitle)
 225        {
 1226            throw new TitleNotCompatibleWithLangError(incompatibleTitle)
 1227            {
 1228
 1229            };
 230        }
 231
 232        public static WrongNumberOfTabularIRIsProvidedError GetWrongNumberOfTabularIRIsProvidedError(int numberOfIRIs)
 233        {
 0234            return new WrongNumberOfTabularIRIsProvidedError(numberOfIRIs);
 235        }
 236
 237        public static void ThrowMissingContextError(JToken topLevelObject)
 238        {
 0239            throw new MissingContextError(topLevelObject);
 240        }
 241
 242        public static void ThrowInvalidContextValueError(string wrongValue, string detectedDatatype)
 243        {
 0244            throw new InvalidContextValueError(wrongValue, detectedDatatype);
 245        }
 246
 247        public static void ThrowRemoteFileResoltuionError(string fileIRI, string additionalInfo)
 248        {
 1249            throw new RemoteFileResoltuionError(fileIRI, additionalInfo);
 250        }
 251
 252        public static void ThrowUnsupportedSchemeError(string parameter)
 253        {
 0254            throw new UnsupportedSchemeError(parameter);
 255        }
 256
 257        public static ColumnsCountMismatchValidationError GetColumnsCountMismatchValidationError(Row annotatedRow)
 258        {
 1259            return new ColumnsCountMismatchValidationError(annotatedRow);
 260        }
 261
 262        public static DuplicateInPKValidationError GetDuplicateInPKValidationError(Row annotatedRow, string PKDuplicate)
 263        {
 1264            return new DuplicateInPKValidationError(annotatedRow, PKDuplicate);
 265        }
 266
 267        public static DuplicateInFKReferencedColumnsValidationError GetDuplicateInFKReferencedColumnsValidationError(Tab
 268        {
 1269            return new DuplicateInFKReferencedColumnsValidationError(table, duplicatedValues, rowNumber);
 270        }
 271
 272        public static NotAllReferencedValuesExistValidationError GetNotAllReferencedValuesExistValidationError(Table ref
 273        {
 1274            return new NotAllReferencedValuesExistValidationError(referencingTable, referencedTable, referencingValues);
 275        }
 276
 277        public static EmptyCellInRequiredColumnVE GetEmptyCellInRequiredColumnVE(Cell annotatedCell)
 278        {
 1279            return new EmptyCellInRequiredColumnVE(annotatedCell);
 280        }
 281
 282        public static CouldNotOpenFileVE GetCouldNotOpenFileVE(string fileIRI)
 283        {
 0284            return new CouldNotOpenFileVE(fileIRI);
 285        }
 286
 287        public static TableSchemesNotCompatibleError GetTableSchemesNotCompatibleError(string tableUrl, int confilctingN
 288        {
 1289            return new TableSchemesNotCompatibleError(tableUrl, confilctingNumber);
 290        }
 291
 292        public static DatatypeLengthConstraintVE GetDatatypeLengthConstraintVE(Cell annoatatedCell)
 293        {
 1294            return new DatatypeLengthConstraintVE(annoatatedCell);
 295        }
 296
 297        public static DatatypeValueConstraintVE GetDatatypeValueConstraintVE(Cell annotatedCell)
 298        {
 1299            return new DatatypeValueConstraintVE(annotatedCell);
 300        }
 301
 302        public static CharOutsideQuotesVE GetCharOutsideQuotesVE(string? tableIRI, int rowNumber, int columnNumber)
 303        {
 0304            return new CharOutsideQuotesVE(tableIRI, rowNumber, columnNumber);
 305        }
 306    }
 307}

Methods/Properties

ThrowWrongTypeOfTopLevelObjectError(string)
ThrowZeroTablesInTablesError(string)
ThrowRequiredPropertyMissingError(string, string, string)
ThrowInvalidIDPropertyError(string, string)
ThrowInvalidTypePropertyError(string, string, string)
ThrowIdenticalColumnNamesError(string, string)
ThrowVirtualColumnPrecedesNonVirtualError(int, int, string)
ThrowResourceAndSchemaReferencePresentError(string)
ThrowReferencingColumnDoesNotExistError(ValidateLib.Metadata.Descriptors.TableDescriptor, ValidateLib.Metadata.Descriptors.ForeignKeyDescriptor, string)
ThrowTwoSatisfyingReferencedTablesErrorError(ValidateLib.Metadata.Descriptors.TableDescriptor, ValidateLib.Metadata.Descriptors.ForeignKeyDescriptor, string)
ThrowNoSatisfyingReferencedTableError(ValidateLib.Metadata.Descriptors.TableDescriptor, ValidateLib.Metadata.Descriptors.ForeignKeyDescriptor, string)
ThrowReferencedColumnDoesNotExistError(ValidateLib.Metadata.Descriptors.TableDescriptor, ValidateLib.Metadata.Descriptors.ForeignKeyDescriptor, string)
ThrowCommonPropertyValueErrorError(ValidateLib.Metadata.Properties.CommonProperty, string)
ThrowCommonPropertyValueErrorError(Newtonsoft.Json.Linq.JProperty, string)
ThrowCPInvalidValueTypeError(Newtonsoft.Json.Linq.JObject)
ThrowDatatypeLengthConstraintError(string)
ThrowDatatypeValueConstraintError(string)
ThrowDatatypeValidationError(string)
ThrowInvalidFormatError(string, string)
ThrowLengthConstraintOnInvalidDatatypeBaseError(string, string)
ThrowValueConstraintOnInvalidDatatypeBaseError(string, string)
ThrowInvalidPropertyOnFKDescriptorError(string, string)
ThrowInvalidPropertyOnContextDescriptorError(string, string)
ThrowMetadataFileCouldNotBeLoadedError(string, string)
GetMetadataFileCouldNotBeLoadedError(string, string)
GetUnknownError(string)
GetUserMetadataTablesIrisMismatchMetdataError(int, int, string)
ThrowTitleNotCompatibleWithLangError(string)
GetWrongNumberOfTabularIRIsProvidedError(int)
ThrowMissingContextError(Newtonsoft.Json.Linq.JToken)
ThrowInvalidContextValueError(string, string)
ThrowRemoteFileResoltuionError(string, string)
ThrowUnsupportedSchemeError(string)
GetColumnsCountMismatchValidationError(ValidateLib.TabularData.AnnotatedTabularDataModel.Row)
GetDuplicateInPKValidationError(ValidateLib.TabularData.AnnotatedTabularDataModel.Row, string)
GetDuplicateInFKReferencedColumnsValidationError(ValidateLib.TabularData.AnnotatedTabularDataModel.Table, string, int)
GetNotAllReferencedValuesExistValidationError(ValidateLib.TabularData.AnnotatedTabularDataModel.Table, ValidateLib.TabularData.AnnotatedTabularDataModel.Table, System.Collections.Generic.Dictionary<string, bool>)
GetEmptyCellInRequiredColumnVE(ValidateLib.TabularData.AnnotatedTabularDataModel.Cell)
GetCouldNotOpenFileVE(string)
GetTableSchemesNotCompatibleError(string, int)
GetDatatypeLengthConstraintVE(ValidateLib.TabularData.AnnotatedTabularDataModel.Cell)
GetDatatypeValueConstraintVE(ValidateLib.TabularData.AnnotatedTabularDataModel.Cell)
GetCharOutsideQuotesVE(string, int, int)