Skip to content

Commit

Permalink
Add regression test for issue#11453
Browse files Browse the repository at this point in the history
Resolves #11453
  • Loading branch information
smitpatel committed Sep 10, 2019
1 parent 7df2d6f commit 59465e2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4122,6 +4122,12 @@ public override async Task Member_binding_after_ctor_arguments_fails_with_client
() => base.Member_binding_after_ctor_arguments_fails_with_client_eval(isAsync))).Message));
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task OrderBy_object_type_server_evals(bool isAsync)
{
return base.OrderBy_object_type_server_evals(isAsync);
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

Expand Down
23 changes: 23 additions & 0 deletions test/EFCore.Specification.Tests/Query/SimpleQueryTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5741,5 +5741,28 @@ public virtual async Task Context_based_client_method(bool isAsync)
Assert.Equal(85, result.Count(e => e));
}
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task OrderBy_object_type_server_evals(bool isAsync)
{
Expression<Func<Order, object>>[] orderingExpressions = {
o => o.OrderID,
o => o.OrderDate,
o => o.Customer.CustomerID,
o => o.Customer.City
};

return AssertQuery<Order>(
isAsync,
os => os.OrderBy(orderingExpressions[0])
.ThenBy(orderingExpressions[1])
.ThenBy(orderingExpressions[2])
.ThenBy(orderingExpressions[3])
.Skip(0)
.Take(20),
entryCount: 20,
assertOrder: true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4694,6 +4694,21 @@ FROM [Orders] AS [o]
LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID]");
}

public override async Task OrderBy_object_type_server_evals(bool isAsync)
{
await base.OrderBy_object_type_server_evals(isAsync);

AssertSql(
@"@__p_0='0'
@__p_1='20'
SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID]
ORDER BY [o].[OrderID], [o].[OrderDate], [c].[CustomerID], [c].[City]
OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY");
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

Expand Down

0 comments on commit 59465e2

Please sign in to comment.