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

Query: Enable tests for issue#16229 #16900

Merged
merged 1 commit into from
Aug 2, 2019
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
72 changes: 24 additions & 48 deletions test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1679,8 +1679,7 @@ public virtual Task Where_subquery_distinct_orderby_firstordefault_boolean_with_
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'Union(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([g], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]}))'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Where_subquery_union_firstordefault_boolean(bool isAsync)
{
return AssertQuery<Gear>(
Expand All @@ -1689,8 +1688,7 @@ public virtual Task Where_subquery_union_firstordefault_boolean(bool isAsync)
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'Concat(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([g], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]}))'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Where_subquery_concat_firstordefault_boolean(bool isAsync)
{
return AssertQuery<Gear>(
Expand Down Expand Up @@ -1761,8 +1759,7 @@ public virtual Task Concat_with_groupings(bool isAsync)
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'Concat(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([g], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]}))'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Select_navigation_with_concat_and_count(bool isAsync)
{
return AssertQueryScalar<Gear>(
Expand All @@ -1782,8 +1779,7 @@ public virtual Task Where_subquery_concat_order_by_firstordefault_boolean(bool i
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'Union(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([g], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]}))'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Concat_with_collection_navigations(bool isAsync)
{
return AssertQueryScalar<Gear>(
Expand All @@ -1792,8 +1788,7 @@ public virtual Task Concat_with_collection_navigations(bool isAsync)
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'Union(MaterializeCollectionNavigation(Navigation: Officer.Reports (<Reports>k__BackingField, ICollection<Gear>) Collection ToDependent Gear 5 -1 12 -1 -1, {from Gear g in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Gear]) where ?= (new AnonymousObject(new [] {Convert(Property([o], \"Nickname\"), Object), Convert(Property([o], \"SquadId\"), Object)}) == new AnonymousObject(new [] {Convert(Property([g], \"LeaderNickname\"), Object), Convert(Property([g], \"LeaderSquadId\"), Object)})) =? select [g]}))'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Union_with_collection_navigations(bool isAsync)
{
return AssertQueryScalar<Gear>(
Expand Down Expand Up @@ -2156,7 +2151,7 @@ public virtual void Non_unicode_string_literals_is_used_for_non_unicode_column_w
}
}

[ConditionalFact(Skip = "Issue#16229")]
[ConditionalFact]
public virtual void Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result1()
{
using (var context = CreateContext())
Expand All @@ -2169,17 +2164,12 @@ from g2 in grouping.DefaultIfEmpty()

var result = query.ToList();

Assert.Equal("Marcus", result[0].Nickname);
Assert.Equal(2, result[0].Weapons.Count);
Assert.Equal("Marcus", result[1].Nickname);
Assert.Equal("Marcus", result[2].Nickname);
Assert.Equal("Baird", result[3].Nickname);
Assert.Equal(0, result[3].Weapons.Count);
Assert.Equal("Marcus", result[4].Nickname);
Assert.Equal(new[] { "Marcus", "Marcus", "Marcus", "Marcus", "Baird" }, result.Select(g => g.Nickname));
Assert.Equal(new[] { 0, 0, 0, 2, 0 }, result.Select(g => g.Weapons.Count));
}
}

[ConditionalFact(Skip = "Issue#16229")]
[ConditionalFact]
public virtual void Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result2()
{
using (var context = CreateContext())
Expand All @@ -2192,19 +2182,13 @@ from g2 in grouping.DefaultIfEmpty()

var result = query.ToList();

Assert.Equal("Marcus", result[0].Nickname);
Assert.Equal(2, result[0].Weapons.Count);
Assert.Equal("Baird", result[1].Nickname);
Assert.Equal(2, result[1].Weapons.Count);
Assert.Equal("Marcus", result[2].Nickname);
Assert.Equal("Marcus", result[3].Nickname);
Assert.Equal("Marcus", result[4].Nickname);
Assert.Equal(new[] { "Marcus", "Marcus", "Marcus", "Marcus", "Baird" }, result.Select(g => g.Nickname));
Assert.Equal(new[] { 2, 2, 2, 0, 2 }, result.Select(g => g.Weapons.Count));
}
}

[ConditionalTheory(Skip = "Issue#16229")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result3(bool isAsync)
{
var expectedIncludes = new List<IExpectedInclude>
Expand All @@ -2223,7 +2207,7 @@ from g2 in grouping.DefaultIfEmpty()
expectedIncludes);
}

[ConditionalTheory(Skip = "Issue#16229")]
[ConditionalTheory(Skip = "Issue#16899")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_coalesce_result4(bool isAsync)
{
Expand Down Expand Up @@ -2255,9 +2239,8 @@ from g2 in grouping.DefaultIfEmpty()
});
}

[ConditionalTheory(Skip = "Issue#16229")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_inheritance_and_coalesce_result(bool isAsync)
{
var expectedIncludes = new List<IExpectedInclude>
Expand All @@ -2276,9 +2259,8 @@ from g2 in grouping.DefaultIfEmpty()
expectedIncludes);
}

[ConditionalTheory(Skip = "Issue#16229")]
[InlineData(false)]
//[InlineData(true)] issue #12448
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Include_on_GroupJoin_SelectMany_DefaultIfEmpty_with_conditional_result(bool isAsync)
{
var expectedIncludes = new List<IExpectedInclude>
Expand Down Expand Up @@ -2912,8 +2894,7 @@ public virtual void Where_datetimeoffset_milliseconds_parameter_and_constant()
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'from Gear g in ClientDefaultIfEmpty([grouping])'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Orderby_added_for_client_side_GroupJoin_composite_dependent_to_principal_LOJ_when_incomplete_key_is_used(
bool isAsync)
{
Expand Down Expand Up @@ -3428,8 +3409,7 @@ public virtual Task Select_length_of_string_property(bool isAsync)
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'where (FavoriteWeapon(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([g], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]})).Name == \"Marcus' Lancer\")'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Client_method_on_collection_navigation_in_predicate(bool isAsync)
{
return AssertQuery<Gear>(
Expand All @@ -3440,8 +3420,7 @@ public virtual Task Client_method_on_collection_navigation_in_predicate(bool isA
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'where (FavoriteWeapon(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([g], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]})).Name == \"Cole's Gnasher\")'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Client_method_on_collection_navigation_in_predicate_accessed_by_ef_property(bool isAsync)
{
return AssertQuery<Gear>(
Expand All @@ -3455,8 +3434,7 @@ public virtual Task Client_method_on_collection_navigation_in_predicate_accessed
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'orderby FavoriteWeapon(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([g], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]})).Name desc'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Client_method_on_collection_navigation_in_order_by(bool isAsync)
{
return AssertQuery<Gear>(
Expand All @@ -3469,8 +3447,7 @@ orderby FavoriteWeapon(g.Weapons).Name descending
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'from Gear v in Veterans(MaterializeCollectionNavigation(Navigation: Officer.Reports (<Reports>k__BackingField, ICollection<Gear>) Collection ToDependent Gear 5 -1 12 -1 -1, {from Gear g in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Gear]) where ?= (new AnonymousObject(new [] {Convert(Property([g], \"Nickname\"), Object), Convert(Property([g], \"SquadId\"), Object)}) == new AnonymousObject(new [] {Convert(Property([g], \"LeaderNickname\"), Object), Convert(Property([g], \"LeaderSquadId\"), Object)})) =? select [g]}))'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Client_method_on_collection_navigation_in_additional_from_clause(bool isAsync)
{
return AssertQuery<Gear>(
Expand All @@ -3486,8 +3463,7 @@ from v in Veterans(g.Reports)
}

[ConditionalTheory(Skip = "Issue #14935. Cannot eval 'join Gear g in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Gear]) on FavoriteWeapon(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([o], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]})).Name equals FavoriteWeapon(MaterializeCollectionNavigation(Navigation: Gear.Weapons (<Weapons>k__BackingField, ICollection<Weapon>) Collection ToDependent Weapon Inverse: Owner 4 -1 11 -1 -1, {from Weapon w in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel.Weapon]) where ?= (Property([g], \"FullName\") == Property([w], \"OwnerFullName\")) =? select [w]})).Name'")]
[InlineData(false)]
//[InlineData(true)] issue #12449
[MemberData(nameof(IsAsyncData))]
public virtual Task Client_method_on_collection_navigation_in_outer_join_key(bool isAsync)
{
return AssertQuery<Gear>(
Expand Down
Loading