< Summary

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

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