Skip to content

Commit

Permalink
Fix to #21049 - Test: Consider adding Include tests with smaller data…
Browse files Browse the repository at this point in the history
…sets

Fixes #21049
  • Loading branch information
maumar committed Dec 9, 2020
1 parent 2d56999 commit 52ee729
Show file tree
Hide file tree
Showing 9 changed files with 262 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public override async Task Where_math_abs_uncorrelated(bool async)
AssertSql(
@"SELECT c
FROM root c
WHERE ((c[""Discriminator""] = ""OrderDetail"") AND (10 < c[""ProductID""]))");
WHERE (((c[""Discriminator""] = ""OrderDetail"") AND (c[""UnitPrice""] < 7.0)) AND (10 < c[""ProductID""]))");
}

[ConditionalTheory(Skip = "Issue #17246")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,10 @@ public virtual Task Where_math_abs1(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Abs(od.ProductID) > 10),
entryCount: 1939);
ss => ss.Set<OrderDetail>()
.Where(od => od.UnitPrice < 7)
.Where(od => Math.Abs(od.ProductID) > 10),
entryCount: 154);
}

[ConditionalTheory]
Expand All @@ -759,8 +761,10 @@ public virtual Task Where_math_abs2(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Abs(od.Quantity) > 10),
entryCount: 1547);
ss => ss.Set<OrderDetail>()
.Where(od => od.UnitPrice < 7)
.Where(od => Math.Abs(od.Quantity) > 10),
entryCount: 102);
}

[ConditionalTheory]
Expand All @@ -769,8 +773,10 @@ public virtual Task Where_math_abs3(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Abs(od.UnitPrice) > 10),
entryCount: 1677);
ss => ss.Set<OrderDetail>()
.Where(od => od.Quantity < 5)
.Where(od => Math.Abs(od.UnitPrice) > 10),
entryCount: 137);
}

[ConditionalTheory]
Expand All @@ -779,8 +785,10 @@ public virtual Task Where_math_abs_uncorrelated(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Abs(-10) < od.ProductID),
entryCount: 1939);
ss => ss.Set<OrderDetail>()
.Where(od => od.UnitPrice < 7)
.Where(od => Math.Abs(-10) < od.ProductID),
entryCount: 154);
}

[ConditionalTheory]
Expand All @@ -789,8 +797,10 @@ public virtual Task Where_math_ceiling1(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Ceiling(od.Discount) > 0),
entryCount: 838);
ss => ss.Set<OrderDetail>()
.Where(od => od.UnitPrice < 7)
.Where(od => Math.Ceiling(od.Discount) > 0),
entryCount: 51);
}

[ConditionalTheory]
Expand All @@ -799,8 +809,10 @@ public virtual Task Where_math_ceiling2(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Ceiling(od.UnitPrice) > 10),
entryCount: 1677);
ss => ss.Set<OrderDetail>()
.Where(od => od.Quantity < 5)
.Where(od => Math.Ceiling(od.UnitPrice) > 10),
entryCount: 137);
}

[ConditionalTheory]
Expand All @@ -809,8 +821,10 @@ public virtual Task Where_math_floor(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Floor(od.UnitPrice) > 10),
entryCount: 1658);
ss => ss.Set<OrderDetail>()
.Where(od => od.Quantity < 5)
.Where(od => Math.Floor(od.UnitPrice) > 10),
entryCount: 137);
}

[ConditionalTheory]
Expand All @@ -829,8 +843,10 @@ public virtual Task Where_math_round(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Round(od.UnitPrice) > 10),
entryCount: 1662);
ss => ss.Set<OrderDetail>()
.Where(od => od.Quantity < 5)
.Where(od => Math.Round(od.UnitPrice) > 10),
entryCount: 137);
}

[ConditionalTheory]
Expand Down Expand Up @@ -873,8 +889,10 @@ public virtual Task Where_math_truncate(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Math.Truncate(od.UnitPrice) > 10),
entryCount: 1658);
ss => ss.Set<OrderDetail>()
.Where(od => od.Quantity < 5)
.Where(od => Math.Truncate(od.UnitPrice) > 10),
entryCount: 137);
}

[ConditionalTheory]
Expand Down Expand Up @@ -1034,8 +1052,10 @@ public virtual Task Where_guid_newguid(bool async)
{
return AssertQuery(
async,
ss => ss.Set<OrderDetail>().Where(od => Guid.NewGuid() != default),
entryCount: 2155);
ss => ss.Set<OrderDetail>()
.Where(od => od.OrderID % 23 == 17)
.Where(od => Guid.NewGuid() != default),
entryCount: 88);
}

[ConditionalTheory]
Expand Down
Loading

0 comments on commit 52ee729

Please sign in to comment.