Skip to content

Commit

Permalink
Add nullable list tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgi committed Jun 18, 2024
1 parent 1790dcc commit 18decab
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions DuckDB.NET.Test/DuckDBManagedAppenderListTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public void ListValuesBool()
ListValuesInternal("Bool", faker => faker.Random.Bool());
}

[Fact]
public void ListValuesBoolNullable()
{
ListValuesInternal("Bool", faker => faker.Random.Bool().OrNull(faker));
}

[Fact]
public void ListValuesSByte()
{
Expand All @@ -33,6 +39,12 @@ public void ListValuesInt()
{
ListValuesInternal("Integer", faker => faker.Random.Int());
}

[Fact]
public void ListValuesIntNullable()
{
ListValuesInternal("Integer", faker => faker.Random.Int().OrNull(faker));
}

[Fact]
public void ListValuesLong()
Expand Down Expand Up @@ -94,6 +106,12 @@ public void ListValuesDouble()
ListValuesInternal("Double", faker => faker.Random.Double());
}

[Fact]
public void ListValuesDoubleNullable()
{
ListValuesInternal("Double", faker => faker.Random.Double().OrNull(faker));
}

[Fact]
public void ListValuesGuid()
{
Expand Down Expand Up @@ -129,12 +147,6 @@ public void ArrayValuesInt()
ListValuesInternal("Integer", faker => faker.Random.Int(), 5);
}

[Fact]
public void ListValuesNullableDouble()
{
ListValuesInternal("Double", faker => faker.Random.Double().OrNull(faker));
}

private void ListValuesInternal<T>(string typeName, Func<Faker, T> generator, int? length = null)
{
var rows = 2000;
Expand Down

0 comments on commit 18decab

Please sign in to comment.