< Summary

Information
Class: ValidateLib.UtilityClasses.DatatypeUtilityClass
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\UtilityClasses\DatatypeUtilityClass.cs
Line coverage
100%
Covered lines: 52
Uncovered lines: 0
Coverable lines: 52
Total lines: 61
Line coverage: 100%
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
DatatypeUtilityClass()490
IsIdOfBuiltInType(...)20
IsBuiltInType(...)20

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\UtilityClasses\DatatypeUtilityClass.cs

#LineLine coverage
 1namespace ValidateLib.UtilityClasses
 2{
 3    public class DatatypeUtilityClass
 4    {
 15        public static Dictionary<string, string> datatypesIdsAndNames = new Dictionary<string, string>
 16        {
 17            ["anyAtomicType"] = "http://www.w3.org/2001/XMLSchema#",
 18            ["any"] = "http://www.w3.org/2001/XMLSchema#",
 19            ["anyURI"] = "http://www.w3.org/2001/XMLSchema#anyURI",
 110            ["base64Binary"] = "http://www.w3.org/2001/XMLSchema#base64Binary",
 111            ["binary"] = "http://www.w3.org/2001/XMLSchema#base64Binary",
 112            ["boolean"] = "http://www.w3.org/2001/XMLSchema#boolean",
 113            ["byte"] = "http://www.w3.org/2001/XMLSchema#byte",
 114            ["date"] = "http://www.w3.org/2001/XMLSchema#date",
 115            ["dateTime"] = "http://www.w3.org/2001/XMLSchema#dateTime",
 116            ["dateTimeStamp"] = "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
 117            ["datetime"] = "http://www.w3.org/2001/XMLSchema#dateTime",
 118            ["dayTimeDuration"] = "http://www.w3.org/2001/XMLSchema#dayTimeDuration",
 119            ["decimal"] = "http://www.w3.org/2001/XMLSchema#decimal",
 120            ["double"] = "http://www.w3.org/2001/XMLSchema#double",
 121            ["duration"] = "http://www.w3.org/2001/XMLSchema#duration",
 122            ["float"] = "http://www.w3.org/2001/XMLSchema#float",
 123            ["gDay"] = "http://www.w3.org/2001/XMLSchema#gDay",
 124            ["gMonth"] = "http://www.w3.org/2001/XMLSchema#gMonth",
 125            ["gMonthDay"] = "http://www.w3.org/2001/XMLSchema#gMonthDay",
 126            ["gYear"] = "http://www.w3.org/2001/XMLSchema#gYear",
 127            ["gYearMonth"] = "http://www.w3.org/2001/XMLSchema#gYearMonth",
 128            ["hexBinary"] = "http://www.w3.org/2001/XMLSchema#hexBinary",
 129            ["html"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",
 130            ["int"] = "http://www.w3.org/2001/XMLSchema#int",
 131            ["integer"] = "http://www.w3.org/2001/XMLSchema#integer",
 132            ["json"] = "http://www.w3.org/ns/csvw#JSON",
 133            ["language"] = "http://www.w3.org/2001/XMLSchema#language",
 134            ["long"] = "http://www.w3.org/2001/XMLSchema#long",
 135            ["Name"] = "http://www.w3.org/2001/XMLSchema#Name",
 136            ["negativeInteger"] = "http://www.w3.org/2001/XMLSchema#negativeInteger",
 137            ["NMTOKEN"] = "http://www.w3.org/2001/XMLSchema#NMTOKEN",
 138            ["nonNegativeInteger"] = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger",
 139            ["nonPositiveInteger"] = "http://www.w3.org/2001/XMLSchema#nonPositiveInteger",
 140            ["normalizedString"] = "http://www.w3.org/2001/XMLSchema#normalizedString",
 141            ["number"] = "http://www.w3.org/2001/XMLSchema#double",
 142            ["positiveInteger"] = "http://www.w3.org/2001/XMLSchema#positiveInteger",
 143            ["QName"] = "http://www.w3.org/2001/XMLSchema#QName",
 144            ["short"] = "http://www.w3.org/2001/XMLSchema#short",
 145            ["string"] = "http://www.w3.org/2001/XMLSchema#string",
 146            ["time"] = "http://www.w3.org/2001/XMLSchema#time",
 147            ["token"] = "http://www.w3.org/2001/XMLSchema#token",
 148            ["unsignedByte"] = "http://www.w3.org/2001/XMLSchema#unsignedByte",
 149            ["unsignedInt"] = "http://www.w3.org/2001/XMLSchema#unsignedInt",
 150            ["unsignedLong"] = "http://www.w3.org/2001/XMLSchema#unsignedLong",
 151            ["unsignedShort"] = "http://www.w3.org/2001/XMLSchema#unsignedShort",
 152            ["xml"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",
 153            ["yearMonthDuration"] = "http://www.w3.org/2001/XMLSchema#yearMonthDuration"
 154        };
 55
 56
 157        public static bool IsIdOfBuiltInType(string id) => datatypesIdsAndNames.ContainsValue(id);
 58
 159        public static bool IsBuiltInType(string type) => datatypesIdsAndNames.ContainsKey(type);
 60    }
 61}