From 9c0dbf81801ae584a32c010f5a372846f3a72618 Mon Sep 17 00:00:00 2001 From: Giorgi Date: Wed, 19 Jun 2024 13:28:50 +0400 Subject: [PATCH] More nullable list tests --- .../DuckDBManagedAppenderListTests.cs | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/DuckDB.NET.Test/DuckDBManagedAppenderListTests.cs b/DuckDB.NET.Test/DuckDBManagedAppenderListTests.cs index 653e181..1adf5eb 100644 --- a/DuckDB.NET.Test/DuckDBManagedAppenderListTests.cs +++ b/DuckDB.NET.Test/DuckDBManagedAppenderListTests.cs @@ -28,12 +28,25 @@ public void ListValuesSByte() ListValuesInternal("TinyInt", faker => faker.Random.SByte()); } + [Fact] + public void ListValuesSByteNullable() + { + ListValuesInternal("TinyInt", faker => faker.Random.SByte().OrNull(faker)); + } + [Fact] public void ListValuesShort() { ListValuesInternal("SmallInt", faker => faker.Random.Short()); } + [Fact] + public void ListValuesShortNullable() + { + ListValuesInternal("SmallInt", faker => faker.Random.Short().OrNull(faker)); + } + + [Fact] public void ListValuesInt() { @@ -52,6 +65,12 @@ public void ListValuesLong() ListValuesInternal("BigInt", faker => faker.Random.Long()); } + [Fact] + public void ListValuesLongNullable() + { + ListValuesInternal("BigInt", faker => faker.Random.Long().OrNull(faker)); + } + [Fact] public void ListValuesHugeInt() { @@ -64,24 +83,48 @@ public void ListValuesByte() ListValuesInternal("UTinyInt", faker => faker.Random.Byte()); } + [Fact] + public void ListValuesByteNullable() + { + ListValuesInternal("UTinyInt", faker => faker.Random.Byte().OrNull(faker)); + } + [Fact] public void ListValuesUShort() { ListValuesInternal("USmallInt", faker => faker.Random.UShort()); } + [Fact] + public void ListValuesUShortNullable() + { + ListValuesInternal("USmallInt", faker => faker.Random.UShort().OrNull(faker)); + } + [Fact] public void ListValuesUInt() { ListValuesInternal("UInteger", faker => faker.Random.UInt()); } + [Fact] + public void ListValuesUIntNullable() + { + ListValuesInternal("UInteger", faker => faker.Random.UInt().OrNull(faker)); + } + [Fact] public void ListValuesULong() { ListValuesInternal("UBigInt", faker => faker.Random.ULong()); } + [Fact] + public void ListValuesULongNullable() + { + ListValuesInternal("UBigInt", faker => faker.Random.ULong().OrNull(faker)); + } + [Fact] public void ListValuesUHugeInt() { @@ -94,12 +137,24 @@ public void ListValuesDecimal() ListValuesInternal("Decimal(38,28)", faker => faker.Random.Decimal()); } + [Fact] + public void ListValuesDecimalNullable() + { + ListValuesInternal("Decimal(38,28)", faker => faker.Random.Decimal().OrNull(faker)); + } + [Fact] public void ListValuesFloat() { ListValuesInternal("Float", faker => faker.Random.Float()); } + [Fact] + public void ListValuesFloatNullable() + { + ListValuesInternal("Float", faker => faker.Random.Float().OrNull(faker)); + } + [Fact] public void ListValuesDouble() { @@ -118,6 +173,12 @@ public void ListValuesGuid() ListValuesInternal("UUID", faker => faker.Random.Guid()); } + [Fact] + public void ListValuesGuidNullable() + { + ListValuesInternal("UUID", faker => faker.Random.Guid().OrNull(faker)); + } + [Fact] public void ListValuesDate() {