< Summary

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

#LineLine coverage
 1using ValidateLib.ErrorsAndWarnings.Errors.Specific;
 2using ValidateLib.Metadata.Descriptors;
 3using ValidateLib.TabularData.Datatypes.NumericDatatypes;
 4
 5namespace DatatypeTests
 6{
 7    public class ByteTests
 8    {
 9
 10
 11        [Theory]
 12        [InlineData("+122")]
 13        [InlineData("-3")]
 14        [InlineData("015")]
 15        [InlineData("127")]
 16        [InlineData("-128")]
 17        public void ValidByteWithoutPatternTest(string stringValue)
 118        {
 119            ByteDT bytedt = new ByteDT(stringValue);
 120        }
 21
 22        [Theory]
 23        [InlineData("not a decimal")]
 24        [InlineData("128")]
 25        [InlineData("-129")]
 26        [InlineData("3.0")]
 27        [InlineData("")]
 28
 29        public void ByteWithoutPatternInvalidValues(string stringValue)
 130        {
 131            Assert.Throws<DatatypeValidationError>(() => new ByteDT(stringValue));
 132        }
 33
 34        [Theory]
 35        [InlineData("+1;0;0", ";", null)]
 36        [InlineData("+1,0,0", ",", null)]
 37
 38        public void ByteWithFormatWithoutPatternValidValues(string stringValue, string? groupChar, string? decimalChar)
 139        {
 140            FormatDescriptor format = new FormatDescriptor
 141            {
 142                groupChar = groupChar,
 143                decimalChar = decimalChar,
 144            };
 45
 146            var bytedt = new ByteDT(stringValue, format);
 147        }
 48
 49    }
 50}