Skip to content

Commit

Permalink
Adds tests for Cosmos on translating binary checked operations to the…
Browse files Browse the repository at this point in the history
…ir unchecked equivalents
  • Loading branch information
svengeance committed Feb 10, 2020
1 parent 913cf9a commit 5151090
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4057,6 +4057,16 @@ public override Task Anonymous_projection_skip_take_empty_collection_FirstOrDefa
return base.Anonymous_projection_skip_take_empty_collection_FirstOrDefault(async);
}

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

AssertSql(@"SELECT c
FROM root c
WHERE ((c[""Discriminator""] = ""OrderDetail"") AND ((c[""Quantity""] + 1) = 5))
ORDER BY c[""OrderID""]");
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5691,5 +5691,22 @@ public virtual Task Anonymous_projection_skip_take_empty_collection_FirstOrDefau
.Take(1)
.Select(e => e.Customer.Orders.FirstOrDefault()));
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Checked_context_with_addition_does_not_fail(bool isAsync)
{
checked
{
return AssertQuery(
isAsync,
ss => ss.Set<OrderDetail>()
.Where(w => w.Quantity + 1 == 5)
.OrderBy(o => o.OrderID),
entryCount: 55,
assertOrder: true,
elementAsserter: (e, a) => { AssertEqual(e, a); });
}
}
}
}

0 comments on commit 5151090

Please sign in to comment.