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

Commit 5c7a7f0

Browse files
committed
Update test to pass with other RDBMS providers
1 parent 783858b commit 5c7a7f0

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

tests/ServiceStack.OrmLite.Tests/Expression/SelectExpressionTests.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -292,25 +292,19 @@ public void Can_Select_Single_from_just_FROM_Expression()
292292
}
293293
}
294294

295-
296295
[Test]
297296
public void Can_Select_Filed_Alias_Expression()
298297
{
299-
300-
using (var db = OpenDbConnection())
301-
{
302-
var sql = db.From<Employee>()
303-
.Join<Company>((e, c) => e.CompanyId == c.Id)
304-
.Select<Employee, Company>((e, c) =>
305-
new
306-
{
307-
Id = e.Id,
308-
Name = e.Name, // test this property use alias
309-
CompanyName = c.Name
310-
});
311-
Assert.AreEqual(sql.SelectExpression, "SELECT \"Employee\".\"Id\", \"Employee\".\"EmployeeName\" AS \"Name\", \"Company\".\"CompanyName\" AS \"CompanyName\"");
312-
}
313-
298+
using var db = OpenDbConnection();
299+
var sql = db.From<Employee>()
300+
.Join<Company>((e, c) => e.CompanyId == c.Id)
301+
.Select<Employee, Company>((e, c) => new {
302+
Id = e.Id,
303+
Name = e.Name, // test this property use alias
304+
CompanyName = c.Name
305+
});
306+
Assert.That(sql.SelectExpression.NormalizeSql(), Is.EqualTo(
307+
"select employee.id, employee.employeename as name, company.companyname as companyname"));
314308
}
315309
}
316310

0 commit comments

Comments
 (0)