< Summary

Information
Class: ValidateLib.TabularData.Datatypes.DurationDatatypes.YearMonthDurationDT
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\TabularData\Datatypes\DurationDatatypes\YearMonthDurationDT.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 26
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

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\TabularData\Datatypes\DurationDatatypes\YearMonthDurationDT.cs

#LineLine coverage
 1using System.Text.RegularExpressions;
 2using ValidateLib.ErrorsAndWarnings.Errors;
 3using ValidateLib.Metadata.Descriptors;
 4
 5namespace ValidateLib.TabularData.Datatypes.DurationDatatypes
 6{
 7    public class YearMonthDurationDT : DurationDT
 8    {
 19        public YearMonthDurationDT() { }
 110        public YearMonthDurationDT(string stringValue) : base(stringValue)
 11        {
 112            ValidateLexicalSpace(stringValue);
 113        }
 14
 115        public YearMonthDurationDT(string stringValue, FormatDescriptor format) : base(stringValue, format)
 16        {
 117            ValidateLexicalSpace(stringValue);
 118        }
 19
 20        void ValidateLexicalSpace(string stringValue)
 21        {
 122            if (Regex.IsMatch(stringValue, "[DT]"))
 123                ErrorFactory.ThrowDatatypeValidationError(stringValue);
 124        }
 25    }
 26}