< Summary

Information
Class: DatatypeTests.NegativeIntegerTests
Assembly: datatypetests.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\Tests\DatatypeTests\Numeric\NegativeIntegerTests.cs
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 47
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\Tests\DatatypeTests\Numeric\NegativeIntegerTests.cs

#LineLine coverage
 1using ValidateLib.ErrorsAndWarnings.Errors.Specific;
 2using ValidateLib.Metadata.Descriptors;
 3using ValidateLib.TabularData.Datatypes.NumericDatatypes;
 4
 5namespace DatatypeTests
 6{
 7    public class NegativeIntegerTests
 8    {
 9
 10
 11        [Theory]
 12        [InlineData("-3")]
 13        [InlineData("-00123")]
 14        public void ValidNegativeIntegerWithoutPatternTest(string stringValue)
 115        {
 116            NegativeIntegerDT ni = new NegativeIntegerDT(stringValue);
 117        }
 18
 19        [Theory]
 20        [InlineData("not a decimal")]
 21        [InlineData("0")]
 22        [InlineData("+9223372")]
 23        [InlineData("3.0")]
 24        [InlineData("")]
 25
 26        public void NegativeIntegerWithoutPatternInvalidValues(string stringValue)
 127        {
 128            Assert.Throws<DatatypeValidationError>(() => new NegativeIntegerDT(stringValue));
 129        }
 30
 31        [Theory]
 32        [InlineData("-1;0;0", ";", null)]
 33        [InlineData("-1,0,0", ",", null)]
 34
 35        public void NegativeIntegerWithFormatWithoutPatternValidValues(string stringValue, string? groupChar, string? de
 136        {
 137            FormatDescriptor format = new FormatDescriptor
 138            {
 139                groupChar = groupChar,
 140                decimalChar = decimalChar,
 141            };
 42
 143            var shortdt = new NegativeIntegerDT(stringValue, format);
 144        }
 45
 46    }
 47}