Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression test for count after client eval #23029

Merged
merged 1 commit into from
Oct 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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