| | 1 | | using ValidateLib.ErrorsAndWarnings.Errors.Specific; |
| | 2 | | using ValidateLib.Metadata.Descriptors; |
| | 3 | | using ValidateLib.TabularData.Datatypes.NumericDatatypes; |
| | 4 | |
|
| | 5 | | namespace DatatypeTests |
| | 6 | | { |
| | 7 | | public class UnsingedLongTests |
| | 8 | | { |
| | 9 | |
|
| | 10 | |
|
| | 11 | | [Theory] |
| | 12 | | [InlineData("+3")] |
| | 13 | | [InlineData("122")] |
| | 14 | | [InlineData("0")] |
| | 15 | | public void ValidUnsignedLongWithoutPatternTest(string stringValue) |
| 1 | 16 | | { |
| 1 | 17 | | UnsignedLongDT ulongdt = new UnsignedLongDT(stringValue); |
| 1 | 18 | | } |
| | 19 | |
|
| | 20 | | [Theory] |
| | 21 | | [InlineData("not a decimal")] |
| | 22 | | [InlineData("-3.0")] |
| | 23 | | [InlineData("18446744073709551616")] |
| | 24 | | [InlineData("")] |
| | 25 | |
|
| | 26 | | public void UnsignedLongWithoutPatternInvalidValues(string stringValue) |
| 1 | 27 | | { |
| 1 | 28 | | Assert.Throws<DatatypeValidationError>(() => new UnsignedLongDT(stringValue)); |
| 1 | 29 | | } |
| | 30 | |
|
| | 31 | | [Theory] |
| | 32 | | [InlineData("+1;0;0", ";", null)] |
| | 33 | | [InlineData("+1,0,0", ",", null)] |
| | 34 | |
|
| | 35 | | public void UnsignedLongWithFormatWithoutPatternValidValues(string stringValue, string? groupChar, string? decim |
| 1 | 36 | | { |
| 1 | 37 | | FormatDescriptor format = new FormatDescriptor |
| 1 | 38 | | { |
| 1 | 39 | | groupChar = groupChar, |
| 1 | 40 | | decimalChar = decimalChar, |
| 1 | 41 | | }; |
| | 42 | |
|
| 1 | 43 | | var ulongdt = new UnsignedLongDT(stringValue, format); |
| 1 | 44 | | } |
| | 45 | |
|
| | 46 | | } |
| | 47 | | } |