Skip to content

Commit

Permalink
Added more E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WanjohiSammy committed Nov 28, 2024
1 parent a46b41f commit f2c4d60
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,22 @@ public void ComputedPropertyTreatedAsOpenPropertyInOrderBy()
orderByClause.Expression.ShouldBeSingleValueOpenPropertyAccessQueryNode("DoubleTotal");
}

[Fact]
public void ComputedPropertyTreatedAsOpenPropertyInCastAndOrderBy()
{
var odataQueryOptionParser = new ODataQueryOptionParser(HardCodedTestModel.TestModel,
HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet(),
new Dictionary<string, string>()
{
{"$orderby", "DoubleTotal asc"},
{"$apply", "aggregate(cast(FavoriteNumber, edm.int64) with sum as Total)/compute(Total mul 2 as DoubleTotal)"}
}) { Resolver = new ODataUriResolver() { EnableCaseInsensitive = true } };
var applyClause = odataQueryOptionParser.ParseApply();
var orderByClause = odataQueryOptionParser.ParseOrderBy();
Assert.Equal(OrderByDirection.Ascending, orderByClause.Direction);
orderByClause.Expression.ShouldBeSingleValueOpenPropertyAccessQueryNode("DoubleTotal");
}

[Fact]
public void DollarComputedPropertyTreatedAsOpenPropertyInOrderBy()
{
Expand Down

0 comments on commit f2c4d60

Please sign in to comment.