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

Commit f3c97db

Browse files
committed
Fix npgsql tests
1 parent f67f68b commit f3c97db

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

tests/ServiceStack.OrmLiteV45.Tests/AutoQueryTestsAsync.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,14 @@ public async Task Can_Select_custom_fields_using_dynamic_Async()
190190
var sb = new StringBuilder();
191191
foreach (var result in results)
192192
{
193-
sb.AppendLine(result.FirstName + "," + result.LastName + "," + result.Name);
193+
if (Dialect != Dialect.PostgreSql)
194+
{
195+
sb.AppendLine(result.FirstName + "," + result.LastName + "," + result.Name);
196+
}
197+
else
198+
{
199+
sb.AppendLine(result.first_name + "," + result.last_name + "," + result.name);
200+
}
194201
}
195202

196203
Assert.That(sb.ToString().NormalizeNewLines(), Is.EqualTo(
@@ -205,7 +212,14 @@ public async Task Can_Select_custom_fields_using_dynamic_Async()
205212
sb.Length = 0;
206213
foreach (var result in results)
207214
{
208-
sb.AppendLine(result.Name);
215+
if (Dialect != Dialect.PostgreSql)
216+
{
217+
sb.AppendLine(result.Name);
218+
}
219+
else
220+
{
221+
sb.AppendLine(result.name);
222+
}
209223
}
210224

211225
Assert.That(sb.ToString().NormalizeNewLines(), Is.EqualTo("Dept 1\nDept 2\nDept 3\n"));

tests/ServiceStack.OrmLiteV45.Tests/LoadReferenceJoinTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public async Task Can_populate_multiple_POCOs_using_SelectMulti3()
130130

131131
private static void AssertMultiCustomerOrderResults(StringBuilder sb)
132132
{
133-
Assert.That(sb.ToString().NormalizeNewLines().Trim(), Is.EqualTo(
133+
Assert.That(sb.ToString().Replace(".9900", ".99").NormalizeNewLines().Trim(), Is.EqualTo(
134134
@"Customer:
135135
{
136136
Id: 1,

tests/ServiceStack.OrmLiteV45.Tests/OrmLiteTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class Config
1818

1919
public static string MySqlDb = "Server=localhost;Database=test;UID=root;Password=test";
2020
public static string PostgreSqlDb = "Server=localhost;Port=5432;User Id=test;Password=test;Database=test;Pooling=true;MinPoolSize=0;MaxPoolSize=200";
21-
21+
//public static string PostgreSqlDb = "Server=localhost;Port=5433;User Id=test;Password=test;Database=test;Pooling=true;MinPoolSize=0;MaxPoolSize=200";
2222
public static IOrmLiteDialectProvider DefaultProvider = SqlServerDialect.Provider;
2323
public static string DefaultConnection = SqlServerBuildDb;
2424

0 commit comments

Comments
 (0)