Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 2829f31

Browse files
authored
Fix test execute stored procedure w/ array args (#646)
Fixes the test and removes the test [Ignore] attribute. Also adds additional execute option, with and without [Alias("")] attribute.
1 parent 2afdb4f commit 2829f31

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

tests/ServiceStack.OrmLite.PostgreSQL.Tests/OrmLiteExecuteProcedureTests.cs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,48 @@ IF v_integer_values[3] <> 3 THEN
4242
private const string Drop = "DROP FUNCTION f_service_stack(text[], integer[]);";
4343

4444
[Alias("f_service_stack")]
45-
public class ServiceStackFunction
45+
public class ServiceStackFunctionWithAlias
4646
{
4747
[CustomField("text[]")]
48+
[Alias("v_string_values")]
4849
public string[] StringValues { get; set; }
4950
[CustomField("integer[]")]
51+
[Alias("v_integer_values")]
5052
public int[] IntegerValues { get; set; }
5153
}
5254

55+
[Alias("f_service_stack")]
56+
public class ServiceStackFunctionNoAlias
57+
{
58+
[CustomField("text[]")]
59+
public string[] v_string_values { get; set; }
60+
[CustomField("int[]")]
61+
public int[] v_integer_values { get; set; }
62+
}
63+
5364
[Test]
54-
[Ignore("This test fails both on .NET and .NET Core")]
5565
public void Can_execute_stored_procedure_with_array_arguments()
5666
{
5767
using (var db = OpenDbConnection())
5868
{
5969
db.ExecuteSql(Create);
6070
db.GetLastSql().Print();
6171

62-
db.ExecuteProcedure(new ServiceStackFunction
72+
// Execute using [Alias()] attribute
73+
db.ExecuteProcedure(new ServiceStackFunctionWithAlias
6374
{
6475
StringValues = new[] { "ServiceStack", "Thoughtfully Architected" },
6576
IntegerValues = new[] { 1, 2, 3 }
6677
});
78+
db.GetLastSql().Print();
79+
80+
// Execute without using [Alias()] attribute
81+
db.ExecuteProcedure(new ServiceStackFunctionNoAlias
82+
{
83+
v_string_values = new[] { "ServiceStack", "Thoughtfully Architected" },
84+
v_integer_values = new[] { 1, 2, 3 }
85+
});
86+
db.GetLastSql().Print();
6787

6888
db.ExecuteSql(Drop);
6989
}

0 commit comments

Comments
 (0)