< Summary

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

#LineLine coverage
 1using ValidateLib.ErrorsAndWarnings.Errors.Specific;
 2using ValidateLib.Metadata.Descriptors;
 3using ValidateLib.TabularData.Datatypes.NumericDatatypes;
 4
 5namespace DatatypeTests
 6{
 7    public class NonNegativeIntegerTests
 8    {
 9
 10
 11        [Theory]
 12        [InlineData("+3")]
 13        [InlineData("122")]
 14        [InlineData("0")]
 15        [InlineData("00123")]
 16        public void ValidNonNegativeIntegerWithoutPatternTest(string stringValue)
 117        {
 118            NonNegativeIntegerDT nni = new NonNegativeIntegerDT(stringValue);
 119        }
 20
 21        [Theory]
 22        [InlineData("not a decimal")]
 23        [InlineData("-3.0")]
 24        [InlineData("-30")]
 25        [InlineData("")]
 26
 27        public void NonNegativeIntegerWithoutPatternInvalidValues(string stringValue)
 128        {
 129            Assert.Throws<DatatypeValidationError>(() => new NonNegativeIntegerDT(stringValue));
 130        }
 31
 32        [Theory]
 33        [InlineData("+1;0;0", ";", null)]
 34        [InlineData("+1,0,0", ",", null)]
 35
 36        public void NonNegativeIntegerWithFormatWithoutPatternValidValues(string stringValue, string? groupChar, string?
 137        {
 138            FormatDescriptor format = new FormatDescriptor
 139            {
 140                groupChar = groupChar,
 141                decimalChar = decimalChar,
 142            };
 43
 144            var shortdt = new NonNegativeIntegerDT(stringValue, format);
 145        }
 46
 47    }
 48}