Skip to content

Commit

Permalink
Add regression test for count after client eval (#23029)
Browse files Browse the repository at this point in the history
Closes #18341
  • Loading branch information
roji authored Oct 17, 2020
1 parent 82232b3 commit 4ddfde1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions All.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ Licensed under the Apache License, Version 2.0. See License.txt in the project r
<s:Boolean x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=FileEF4F00E20178B341995BD2EFE53739B5/@KeyIndexDefined">True</s:Boolean>
<s:Double x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=FileEF4F00E20178B341995BD2EFE53739B5/RelativePriority/@EntryValue">2</s:Double>
<s:String x:Key="/Default/Environment/PerformanceGuide/SwitchBehaviour/=VsBulb/@EntryIndexedValue">DO_NOTHING</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002EDaemon_002ESettings_002EMigration_002ESwaWarningsModeSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,15 @@ public override async Task Average_on_nav_subquery_in_projection(bool isAsync)
@"");
}

[ConditionalTheory(Skip = "Issue#16146")]
public override async Task Count_after_client_projection(bool isAsync)
{
await base.Count_after_client_projection(isAsync);

AssertSql(
@"");
}

[ConditionalTheory(Skip = "Issue#17246")]
public override async Task OrderBy_client_Take(bool async)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2009,5 +2009,20 @@ public virtual Task Average_on_nav_subquery_in_projection(bool isAsync)
}
});
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Count_after_client_projection(bool isAsync)
{
return AssertCount(
isAsync,
ss => ss.Set<Order>()
.Select(o => new
{
o.OrderID,
Customer = o.Customer is Customer ? new { o.Customer.ContactName } : null
})
.Take(1));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,20 @@ FROM [Customers] AS [c]
ORDER BY [c].[CustomerID]");
}

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

AssertSql(
@"@__p_0='1'
SELECT COUNT(*)
FROM (
SELECT TOP(@__p_0) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM [Orders] AS [o]
) AS [t]");
}

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

Expand Down

0 comments on commit 4ddfde1

Please sign in to comment.