Skip to content

Commit f724638

Browse files
committed
Add PostgreSQL test for array
1 parent cfce48e commit f724638

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Dapper.Tests/Providers/PostgresqlTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Data;
33
using System.Data.Common;
44
using System.Linq;
5+
using Microsoft.VisualBasic;
56
using Xunit;
67

78
namespace Dapper.Tests
@@ -77,6 +78,17 @@ public void TestPostgresqlChar()
7778
}
7879
}
7980

81+
[FactPostgresql]
82+
public void TestPostgresqlArray()
83+
{
84+
using (var conn = GetOpenNpgsqlConnection())
85+
{
86+
var r = conn.Query<int[]>("select array[1,2,3]").ToList();
87+
Assert.Single(r);
88+
Assert.Equal(new[] { 1, 2, 3 }, r.Single());
89+
}
90+
}
91+
8092
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
8193
public class FactPostgresqlAttribute : FactAttribute
8294
{

0 commit comments

Comments
 (0)