From 2d57c6fb8ffc94c6de943ae51cc3530fdbab4848 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 1 Sep 2025 00:07:51 +0200 Subject: [PATCH 1/2] Bump version to 10.0.0-rc.1 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index cfac27e0d2..4b55c246ee 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 10.0.0-preview.7 + 10.0.0-rc.1 net10.0 latest enable From d2e1a3d1ded1824987e35a32f8d5b915491b0b2f Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 1 Sep 2025 08:07:08 +0200 Subject: [PATCH 2/2] Sync to EF 10.0.0-rc.2.25431.101 --- Directory.Build.props | 2 +- Directory.Packages.props | 4 +- .../ComplexTypeBulkUpdatesNpgsqlTest.cs | 9 +- .../NpgsqlComplianceTest.cs | 14 +- .../Query/ArrayArrayQueryTest.cs | 54 +++- .../Query/ArrayListQueryTest.cs | 54 +++- .../ComplexJsonCollectionNpgsqlTest.cs | 2 +- .../ComplexJsonMiscellaneousNpgsqlTest.cs | 42 ++- .../ComplexJson/ComplexJsonNpgsqlFixture.cs | 2 +- .../ComplexJsonProjectionNpgsqlTest.cs | 38 ++- .../ComplexJsonSetOperationsNpgsqlTest.cs | 2 +- ...ComplexJsonStructuralEqualityNpgsqlTest.cs | 281 ++++++++++++++++++ ...exTableSplittingMiscellaneousNpgsqlTest.cs | 42 ++- .../ComplexTableSplittingNpgsqlFixture.cs | 2 +- ...mplexTableSplittingProjectionNpgsqlTest.cs | 53 +++- ...leSplittingStructuralEqualityNpgsqlTest.cs | 50 +++- .../NavigationsCollectionNpgsqlTest.cs | 2 +- .../NavigationsIncludeNpgsqlTest.cs | 2 +- .../NavigationsMiscellaneousNpgsqlTest.cs | 2 +- .../Navigations/NavigationsNpgsqlFixture.cs | 2 +- .../NavigationsProjectionNpgsqlTest.cs | 2 +- .../NavigationsSetOperationsNpgsqlTest.cs | 2 +- ...NavigationsStructuralEqualityNpgsqlTest.cs | 138 ++++++++- .../OwnedJsonCollectionNpgsqlTest.cs | 4 +- .../OwnedJsonMiscellaneousNpgsqlTest.cs | 2 +- .../OwnedJson/OwnedJsonNpgsqlFixture.cs | 2 +- .../OwnedJsonProjectionNpgsqlTest.cs | 2 +- .../OwnedJsonStructuralEqualityNpgsqlTest.cs | 34 ++- .../OwnedJson/OwnedJsonTypeNpgsqlFixture.cs | 2 +- .../OwnedNavigationsCollectionNpgsqlTest.cs | 5 +- ...OwnedNavigationsMiscellaneousNpgsqlTest.cs | 5 +- .../OwnedNavigationsNpgsqlFixture.cs | 2 +- .../OwnedNavigationsProjectionNpgsqlTest.cs | 5 +- ...OwnedNavigationsSetOperationsNpgsqlTest.cs | 2 +- ...NavigationsStructuralEqualityNpgsqlTest.cs | 37 ++- ...edTableSplittingMiscellaneousNpgsqlTest.cs | 5 +- .../OwnedTableSplittingNpgsqlFixture.cs | 2 +- ...OwnedTableSplittingProjectionNpgsqlTest.cs | 5 +- ...leSplittingStructuralEqualityNpgsqlTest.cs | 37 ++- .../Query/ComplexTypeQueryNpgsqlTest.cs | 6 +- ...thwindAggregateOperatorsQueryNpgsqlTest.cs | 21 +- .../NorthwindMiscellaneousQueryNpgsqlTest.cs | 31 +- .../Query/PrecompiledQueryNpgsqlTest.cs | 4 +- .../PrimitiveCollectionsQueryNpgsqlTest.cs | 158 ++++++---- ...ComplexJsonStructuralEqualityNpgsqlTest.cs | 152 ---------- .../Translations/LTreeTranslationsTest.cs | 27 +- .../MultirangeTranslationsTest.cs | 27 +- 47 files changed, 1042 insertions(+), 336 deletions(-) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs (98%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexJson/ComplexJsonMiscellaneousNpgsqlTest.cs (56%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexJson/ComplexJsonNpgsqlFixture.cs (81%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexJson/ComplexJsonProjectionNpgsqlTest.cs (89%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexJson/ComplexJsonSetOperationsNpgsqlTest.cs (97%) create mode 100644 test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonStructuralEqualityNpgsqlTest.cs rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexTableSplitting/ComplexTableSplittingMiscellaneousNpgsqlTest.cs (52%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexTableSplitting/ComplexTableSplittingNpgsqlFixture.cs (81%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexTableSplitting/ComplexTableSplittingProjectionNpgsqlTest.cs (79%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/ComplexTableSplitting/ComplexTableSplittingStructuralEqualityNpgsqlTest.cs (87%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/Navigations/NavigationsCollectionNpgsqlTest.cs (99%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/Navigations/NavigationsIncludeNpgsqlTest.cs (99%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/Navigations/NavigationsMiscellaneousNpgsqlTest.cs (99%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/Navigations/NavigationsNpgsqlFixture.cs (81%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/Navigations/NavigationsProjectionNpgsqlTest.cs (99%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/Navigations/NavigationsSetOperationsNpgsqlTest.cs (99%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/Navigations/NavigationsStructuralEqualityNpgsqlTest.cs (68%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs (98%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedJson/OwnedJsonMiscellaneousNpgsqlTest.cs (95%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedJson/OwnedJsonNpgsqlFixture.cs (81%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedJson/OwnedJsonProjectionNpgsqlTest.cs (99%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedJson/OwnedJsonStructuralEqualityNpgsqlTest.cs (80%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedJson/OwnedJsonTypeNpgsqlFixture.cs (92%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs (98%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedNavigations/OwnedNavigationsMiscellaneousNpgsqlTest.cs (97%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedNavigations/OwnedNavigationsNpgsqlFixture.cs (80%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedNavigations/OwnedNavigationsProjectionNpgsqlTest.cs (98%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedNavigations/OwnedNavigationsSetOperationsNpgsqlTest.cs (99%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedNavigations/OwnedNavigationsStructuralEqualityNpgsqlTest.cs (96%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedTableSplitting/OwnedTableSplittingMiscellaneousNpgsqlTest.cs (97%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedTableSplitting/OwnedTableSplittingNpgsqlFixture.cs (80%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedTableSplitting/OwnedTableSplittingProjectionNpgsqlTest.cs (98%) rename test/EFCore.PG.FunctionalTests/Query/{Relationships => Associations}/OwnedTableSplitting/OwnedTableSplittingStructuralEqualityNpgsqlTest.cs (96%) delete mode 100644 test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonStructuralEqualityNpgsqlTest.cs diff --git a/Directory.Build.props b/Directory.Build.props index 4b55c246ee..4a66f4f9a5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 10.0.0-rc.1 + 10.0.0-rc.2 net10.0 latest enable diff --git a/Directory.Packages.props b/Directory.Packages.props index e57544cca4..9f8aafc12f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,7 +1,7 @@ - 10.0.0-rc.1.25416.111 - 10.0.0-rc.1.25416.111 + 10.0.0-rc.2.25431.101 + 10.0.0-rc.1.25431.101 9.0.3 diff --git a/test/EFCore.PG.FunctionalTests/BulkUpdates/ComplexTypeBulkUpdatesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BulkUpdates/ComplexTypeBulkUpdatesNpgsqlTest.cs index 8cca5da20a..9e9c4b7329 100644 --- a/test/EFCore.PG.FunctionalTests/BulkUpdates/ComplexTypeBulkUpdatesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BulkUpdates/ComplexTypeBulkUpdatesNpgsqlTest.cs @@ -109,7 +109,8 @@ public override async Task Update_complex_type_to_parameter(bool async) """ @complex_type_p_AddressLine1='New AddressLine1' @complex_type_p_AddressLine2='New AddressLine2' -@complex_type_p_Tags={ 'new_tag1', 'new_tag2' } (DbType = Object) +@complex_type_p_Tags={ 'new_tag1' +'new_tag2' } (DbType = Object) @complex_type_p_ZipCode='99999' (Nullable = true) @complex_type_p_Code='FR' @complex_type_p_FullName='France' @@ -163,7 +164,8 @@ public override async Task Update_complex_type_to_inline_without_lambda(bool asy """ @complex_type_p_AddressLine1='New AddressLine1' @complex_type_p_AddressLine2='New AddressLine2' -@complex_type_p_Tags={ 'new_tag1', 'new_tag2' } (DbType = Object) +@complex_type_p_Tags={ 'new_tag1' +'new_tag2' } (DbType = Object) @complex_type_p_ZipCode='99999' (Nullable = true) @complex_type_p_Code='FR' @complex_type_p_FullName='France' @@ -225,7 +227,8 @@ public override async Task Update_collection_inside_complex_type(bool async) AssertExecuteUpdateSql( """ -@p={ 'new_tag1', 'new_tag2' } (DbType = Object) +@p={ 'new_tag1' +'new_tag2' } (DbType = Object) UPDATE "Customer" AS c SET "ShippingAddress_Tags" = @p diff --git a/test/EFCore.PG.FunctionalTests/NpgsqlComplianceTest.cs b/test/EFCore.PG.FunctionalTests/NpgsqlComplianceTest.cs index 2818565ce3..66e8b515b3 100644 --- a/test/EFCore.PG.FunctionalTests/NpgsqlComplianceTest.cs +++ b/test/EFCore.PG.FunctionalTests/NpgsqlComplianceTest.cs @@ -1,21 +1,9 @@ -using Microsoft.EntityFrameworkCore.Query.Relationships.OwnedNavigations; -using Microsoft.EntityFrameworkCore.Query.Relationships.OwnedTableSplitting; - -namespace Microsoft.EntityFrameworkCore; +namespace Microsoft.EntityFrameworkCore; public class NpgsqlComplianceTest : RelationalComplianceTestBase { protected override ICollection IgnoredTestBases { get; } = new HashSet { - // Temporary, remove for 10.0.0-rc.2 - typeof(OwnedTableSplittingMiscellaneousRelationalTestBase<>), - typeof(OwnedTableSplittingProjectionRelationalTestBase<>), - typeof(OwnedNavigationsCollectionRelationalTestBase<>), - typeof(OwnedNavigationsMiscellaneousRelationalTestBase<>), - typeof(OwnedNavigationsProjectionRelationalTestBase<>), - typeof(OwnedNavigationsStructuralEqualityRelationalTestBase<>), - typeof(OwnedTableSplittingStructuralEqualityRelationalTestBase<>), - // Not implemented typeof(CompiledModelTestBase), typeof(CompiledModelRelationalTestBase), // #3087 typeof(FromSqlSprocQueryTestBase<>), diff --git a/test/EFCore.PG.FunctionalTests/Query/ArrayArrayQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/ArrayArrayQueryTest.cs index cbe860667c..d01d77d96f 100644 --- a/test/EFCore.PG.FunctionalTests/Query/ArrayArrayQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/ArrayArrayQueryTest.cs @@ -119,7 +119,8 @@ public override async Task SequenceEqual_with_parameter(bool async) AssertSql( """ -@arr={ '3', '4' } (DbType = Object) +@arr={ '3' +'4' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -145,7 +146,9 @@ public override async Task SequenceEqual_over_nullable_with_parameter(bool async AssertSql( """ -@arr={ '3', '4', NULL } (DbType = Object) +@arr={ '3' +'4' +NULL } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -287,7 +290,8 @@ await AssertQuery( AssertSql( """ -@array={ 'foo', 'xxx' } (DbType = Object) +@array={ 'foo' +'xxx' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -323,7 +327,9 @@ public override void Array_param_with_null_Contains_non_nullable_not_found() AssertSql( """ -@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1' +'unknown2' +NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s @@ -341,7 +347,9 @@ public override void Array_param_with_null_Contains_non_nullable_not_found_negat AssertSql( """ -@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1' +'unknown2' +NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s @@ -359,7 +367,9 @@ public override void Array_param_with_null_Contains_nullable_not_found() AssertSql( """ -@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1' +'unknown2' +NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s @@ -377,7 +387,9 @@ public override void Array_param_with_null_Contains_nullable_not_found_negated() AssertSql( """ -@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1' +'unknown2' +NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s @@ -395,7 +407,8 @@ await AssertQuery( AssertSql( """ -@values={ '1', '999' } (DbType = Object) +@values={ '1' +'999' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -432,7 +445,8 @@ await AssertQuery( AssertSql( """ -@array={ '-2', '-3' } (DbType = Object) +@array={ '-2' +'-3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -450,7 +464,8 @@ await AssertQuery( AssertSql( """ -@array={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two' +'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -468,7 +483,8 @@ await AssertQuery( AssertSql( """ -@array={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two' +'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -486,7 +502,8 @@ await AssertQuery( AssertSql( """ -@array={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two' +'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -536,7 +553,8 @@ await AssertQuery( AssertSql( """ -@p={ 'Eight', 'Nine' } (DbType = Object) +@p={ 'Eight' +'Nine' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -685,7 +703,9 @@ await AssertQuery( AssertSql( """ -@patternsActual={ 'a%', 'b%', 'c%' } (DbType = Object) +@patternsActual={ 'a%' +'b%' +'c%' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -745,7 +765,8 @@ public override async Task Any_Contains_between_column_and_List(bool async) AssertSql( """ -@ints={ '2', '3' } (DbType = Object) +@ints={ '2' +'3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -759,7 +780,8 @@ public override async Task Any_Contains_between_column_and_array(bool async) AssertSql( """ -@ints={ '2', '3' } (DbType = Object) +@ints={ '2' +'3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s diff --git a/test/EFCore.PG.FunctionalTests/Query/ArrayListQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/ArrayListQueryTest.cs index 02ef5d2a75..cfe626d3be 100644 --- a/test/EFCore.PG.FunctionalTests/Query/ArrayListQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/ArrayListQueryTest.cs @@ -109,7 +109,8 @@ public override async Task SequenceEqual_with_parameter(bool async) AssertSql( """ -@arr={ '3', '4' } (DbType = Object) +@arr={ '3' +'4' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -135,7 +136,9 @@ public override async Task SequenceEqual_over_nullable_with_parameter(bool async AssertSql( """ -@arr={ '3', '4', NULL } (DbType = Object) +@arr={ '3' +'4' +NULL } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -277,7 +280,8 @@ await AssertQuery( AssertSql( """ -@array={ 'foo', 'xxx' } (DbType = Object) +@array={ 'foo' +'xxx' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -318,7 +322,9 @@ public override void Array_param_with_null_Contains_non_nullable_not_found() AssertSql( """ -@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1' +'unknown2' +NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s @@ -341,7 +347,9 @@ public override void Array_param_with_null_Contains_non_nullable_not_found_negat AssertSql( """ -@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1' +'unknown2' +NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s @@ -364,7 +372,9 @@ public override void Array_param_with_null_Contains_nullable_not_found() AssertSql( """ -@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1' +'unknown2' +NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s @@ -387,7 +397,9 @@ public override void Array_param_with_null_Contains_nullable_not_found_negated() AssertSql( """ -@array={ 'unknown1', 'unknown2', NULL } (DbType = Object) +@array={ 'unknown1' +'unknown2' +NULL } (DbType = Object) SELECT count(*)::int FROM "SomeEntities" AS s @@ -405,7 +417,8 @@ await AssertQuery( AssertSql( """ -@values={ '1', '999' } (DbType = Object) +@values={ '1' +'999' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -441,7 +454,8 @@ await AssertQuery( AssertSql( """ -@array={ '-2', '-3' } (DbType = Object) +@array={ '-2' +'-3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -459,7 +473,8 @@ await AssertQuery( AssertSql( """ -@array={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two' +'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -477,7 +492,8 @@ await AssertQuery( AssertSql( """ -@array={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two' +'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -495,7 +511,8 @@ await AssertQuery( AssertSql( """ -@array={ 'Two', 'Three' } (DbType = Object) +@array={ 'Two' +'Three' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -545,7 +562,8 @@ await AssertQuery( AssertSql( """ -@p={ 'Eight', 'Nine' } (DbType = Object) +@p={ 'Eight' +'Nine' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -704,7 +722,9 @@ await AssertQuery( AssertSql( """ -@patternsActual={ 'a%', 'b%', 'c%' } (DbType = Object) +@patternsActual={ 'a%' +'b%' +'c%' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -764,7 +784,8 @@ public override async Task Any_Contains_between_column_and_List(bool async) AssertSql( """ -@ints={ '2', '3' } (DbType = Object) +@ints={ '2' +'3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s @@ -778,7 +799,8 @@ public override async Task Any_Contains_between_column_and_array(bool async) AssertSql( """ -@ints={ '2', '3' } (DbType = Object) +@ints={ '2' +'3' } (DbType = Object) SELECT s."Id", s."ArrayContainerEntityId", s."ArrayOfStringConvertedToDelimitedString", s."Byte", s."ByteArray", s."Bytea", s."EnumConvertedToInt", s."EnumConvertedToString", s."IList", s."IntArray", s."IntList", s."ListOfStringConvertedToDelimitedString", s."NonNullableText", s."NullableEnumConvertedToString", s."NullableEnumConvertedToStringWithNonNullableLambda", s."NullableIntArray", s."NullableIntList", s."NullableStringArray", s."NullableStringList", s."NullableText", s."StringArray", s."StringList", s."ValueConvertedArrayOfEnum", s."ValueConvertedListOfEnum", s."Varchar10", s."Varchar15" FROM "SomeEntities" AS s diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs similarity index 98% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs index 76254b3a53..1b2b11b265 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs @@ -1,4 +1,4 @@ -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexJson; public class ComplexJsonCollectionNpgsqlTest(ComplexJsonNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : ComplexJsonCollectionRelationalTestBase(fixture, testOutputHelper) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonMiscellaneousNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonMiscellaneousNpgsqlTest.cs similarity index 56% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonMiscellaneousNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonMiscellaneousNpgsqlTest.cs index e8ce89b515..7f15a6a349 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonMiscellaneousNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonMiscellaneousNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexJson; public class ComplexJsonMiscellaneousNpgsqlTest(ComplexJsonNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : ComplexJsonMiscellaneousRelationalTestBase(fixture, testOutputHelper) @@ -46,6 +46,46 @@ public override async Task Where_nested_related_property() #endregion Simple filters + #region Value types + + public override async Task Where_property_on_non_nullable_value_type() + { + await base.Where_property_on_non_nullable_value_type(); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated", v."RelatedCollection", v."RequiredRelated" +FROM "ValueRootEntity" AS v +WHERE (CAST(v."RequiredRelated" ->> 'Int' AS integer)) = 8 +"""); + } + + public override async Task Where_property_on_nullable_value_type_Value() + { + await base.Where_property_on_nullable_value_type_Value(); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated", v."RelatedCollection", v."RequiredRelated" +FROM "ValueRootEntity" AS v +WHERE (CAST(v."OptionalRelated" ->> 'Int' AS integer)) = 8 +"""); + } + + public override async Task Where_HasValue_on_nullable_value_type() + { + await base.Where_HasValue_on_nullable_value_type(); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated", v."RelatedCollection", v."RequiredRelated" +FROM "ValueRootEntity" AS v +WHERE (v."OptionalRelated") IS NOT NULL +"""); + } + + #endregion Value types + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonNpgsqlFixture.cs similarity index 81% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonNpgsqlFixture.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonNpgsqlFixture.cs index 702b0b3376..7b0fe9d065 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonNpgsqlFixture.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexJson; public class ComplexJsonNpgsqlFixture : ComplexJsonRelationalFixtureBase { diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonProjectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonProjectionNpgsqlTest.cs similarity index 89% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonProjectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonProjectionNpgsqlTest.cs index e11a7ab251..a3f9936d8e 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonProjectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonProjectionNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexJson; public class ComplexJsonProjectionNpgsqlTest(ComplexJsonNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : ComplexJsonProjectionRelationalTestBase(fixture, testOutputHelper) @@ -307,6 +307,42 @@ public override async Task Select_root_with_value_types(QueryTrackingBehavior qu """); } + public override async Task Select_non_nullable_value_type(QueryTrackingBehavior queryTrackingBehavior) + { + await base.Select_non_nullable_value_type(queryTrackingBehavior); + + AssertSql( + """ +SELECT v."RequiredRelated" +FROM "ValueRootEntity" AS v +ORDER BY v."Id" NULLS FIRST +"""); + } + + public override async Task Select_nullable_value_type(QueryTrackingBehavior queryTrackingBehavior) + { + await base.Select_nullable_value_type(queryTrackingBehavior); + + AssertSql( + """ +SELECT v."OptionalRelated" +FROM "ValueRootEntity" AS v +ORDER BY v."Id" NULLS FIRST +"""); + } + + public override async Task Select_nullable_value_type_with_Value(QueryTrackingBehavior queryTrackingBehavior) + { + await base.Select_nullable_value_type_with_Value(queryTrackingBehavior); + + AssertSql( + """ +SELECT v."OptionalRelated" +FROM "ValueRootEntity" AS v +ORDER BY v."Id" NULLS FIRST +"""); + } + #endregion Value types [ConditionalFact] diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonSetOperationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonSetOperationsNpgsqlTest.cs similarity index 97% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonSetOperationsNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonSetOperationsNpgsqlTest.cs index 9f321bf9e9..80934d305b 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonSetOperationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonSetOperationsNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexJson; public class ComplexJsonSetOperationsNpgsqlTest(ComplexJsonNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : ComplexJsonSetOperationsRelationalTestBase(fixture, testOutputHelper) diff --git a/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonStructuralEqualityNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonStructuralEqualityNpgsqlTest.cs new file mode 100644 index 0000000000..b5e23aebd0 --- /dev/null +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonStructuralEqualityNpgsqlTest.cs @@ -0,0 +1,281 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexJson; + +public class ComplexJsonStructuralEqualityNpgsqlTest(ComplexJsonNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) + : ComplexJsonStructuralEqualityRelationalTestBase(fixture, testOutputHelper) +{ + // The SQL Server json type cannot be compared ("The JSON data type cannot be compared or sorted, except when using the + // IS NULL operator"). + // So we find comparisons that involve the json type, and apply a conversion to string (nvarchar(max)) to both sides. + + public override async Task Two_related() + { + await base.Two_related(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated") = (r."OptionalRelated") +"""); + } + + public override async Task Two_nested() + { + await base.Two_nested(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated" -> 'RequiredNested') = (r."OptionalRelated" -> 'RequiredNested') +"""); + } + + public override async Task Not_equals() + { + await base.Not_equals(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated") <> (r."OptionalRelated") OR (r."OptionalRelated") IS NULL +"""); + } + + public override async Task Related_with_inline_null() + { + await base.Related_with_inline_null(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."OptionalRelated") IS NULL +"""); + } + + public override async Task Related_with_parameter_null() + { + await base.Related_with_parameter_null(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."OptionalRelated") IS NULL +"""); + } + + public override async Task Nested_with_inline_null() + { + await base.Nested_with_inline_null(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated" ->> 'OptionalNested') IS NULL +"""); + } + + public override async Task Nested_with_inline() + { + await base.Nested_with_inline(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated" -> 'RequiredNested') = '{"Id":1000,"Int":8,"Name":"Root1_RequiredRelated_RequiredNested","String":"foo"}' +"""); + } + + public override async Task Nested_with_parameter() + { + await base.Nested_with_parameter(); + + AssertSql( + """ +@entity_equality_nested='?' (DbType = Object) + +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated" -> 'RequiredNested') = @entity_equality_nested +"""); + } + + public override async Task Two_nested_collections() + { + await base.Two_nested_collections(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated" -> 'NestedCollection') = (r."OptionalRelated" -> 'NestedCollection') +"""); + } + + public override async Task Nested_collection_with_inline() + { + await base.Nested_collection_with_inline(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated" -> 'NestedCollection') = '[{"Id":1002,"Int":8,"Name":"Root1_RequiredRelated_NestedCollection_1","String":"foo"},{"Id":1003,"Int":8,"Name":"Root1_RequiredRelated_NestedCollection_2","String":"foo"}]' +"""); + } + + public override async Task Nested_collection_with_parameter() + { + await base.Nested_collection_with_parameter(); + + AssertSql( + """ +@entity_equality_nestedCollection='?' (DbType = Object) + +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE (r."RequiredRelated" -> 'NestedCollection') = @entity_equality_nestedCollection +"""); + } + + #region Contains + + public override async Task Contains_with_inline() + { + await base.Contains_with_inline(); + + // TODO: The following translation is sub-optimal: we should be using OPENSJON to extract elements of the collection as JSON elements (OPENJSON WITH JSON), + // and comparison those elements to a single entire JSON fragment on the other side (just like non-collection JSON comparison), rather than breaking the + // elements down to their columns and doing column-by-column comparison. See #32576. + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE EXISTS ( + SELECT 1 + FROM ROWS FROM (jsonb_to_recordset(r."RequiredRelated" -> 'NestedCollection') AS ( + "Id" integer, + "Int" integer, + "Name" text, + "String" text + )) WITH ORDINALITY AS n + WHERE n."Id" = 1002 AND n."Int" = 8 AND n."Name" = 'Root1_RequiredRelated_NestedCollection_1' AND n."String" = 'foo') +"""); + } + + public override async Task Contains_with_parameter() + { + await base.Contains_with_parameter(); + + // TODO: The following translation is sub-optimal: we should be using OPENSJON to extract elements of the collection as JSON elements (OPENJSON WITH JSON), + // and comparison those elements to a single entire JSON fragment on the other side (just like non-collection JSON comparison), rather than breaking the + // elements down to their columns and doing column-by-column comparison. See #32576. + AssertSql( + """ +@entity_equality_nested_Id='?' (DbType = Int32) +@entity_equality_nested_Int='?' (DbType = Int32) +@entity_equality_nested_Name='?' +@entity_equality_nested_String='?' + +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE EXISTS ( + SELECT 1 + FROM ROWS FROM (jsonb_to_recordset(r."RequiredRelated" -> 'NestedCollection') AS ( + "Id" integer, + "Int" integer, + "Name" text, + "String" text + )) WITH ORDINALITY AS n + WHERE n."Id" = @entity_equality_nested_Id AND n."Int" = @entity_equality_nested_Int AND n."Name" = @entity_equality_nested_Name AND n."String" = @entity_equality_nested_String) +"""); + } + + public override async Task Contains_with_operators_composed_on_the_collection() + { + await base.Contains_with_operators_composed_on_the_collection(); + + AssertSql( + """ +@get_Item_Int='?' (DbType = Int32) +@entity_equality_get_Item_Id='?' (DbType = Int32) +@entity_equality_get_Item_Int='?' (DbType = Int32) +@entity_equality_get_Item_Name='?' +@entity_equality_get_Item_String='?' + +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE EXISTS ( + SELECT 1 + FROM ROWS FROM (jsonb_to_recordset(r."RequiredRelated" -> 'NestedCollection') AS ( + "Id" integer, + "Int" integer, + "Name" text, + "String" text + )) WITH ORDINALITY AS n + WHERE n."Int" > @get_Item_Int AND n."Id" = @entity_equality_get_Item_Id AND n."Int" = @entity_equality_get_Item_Int AND n."Name" = @entity_equality_get_Item_Name AND n."String" = @entity_equality_get_Item_String) +"""); + } + + public override async Task Contains_with_nested_and_composed_operators() + { + await base.Contains_with_nested_and_composed_operators(); + + AssertSql( + """ +@get_Item_Id='?' (DbType = Int32) +@entity_equality_get_Item_Id='?' (DbType = Int32) +@entity_equality_get_Item_Int='?' (DbType = Int32) +@entity_equality_get_Item_Name='?' +@entity_equality_get_Item_String='?' +@entity_equality_get_Item_NestedCollection='?' (DbType = Object) +@entity_equality_get_Item_OptionalNested='?' (DbType = Object) +@entity_equality_get_Item_RequiredNested='?' (DbType = Object) + +SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" +FROM "RootEntity" AS r +WHERE EXISTS ( + SELECT 1 + FROM ROWS FROM (jsonb_to_recordset(r."RelatedCollection") AS ( + "Id" integer, + "Int" integer, + "Name" text, + "String" text, + "NestedCollection" jsonb, + "OptionalNested" jsonb, + "RequiredNested" jsonb + )) WITH ORDINALITY AS r0 + WHERE r0."Id" > @get_Item_Id AND r0."Id" = @entity_equality_get_Item_Id AND r0."Int" = @entity_equality_get_Item_Int AND r0."Name" = @entity_equality_get_Item_Name AND r0."String" = @entity_equality_get_Item_String AND (r0."NestedCollection") = @entity_equality_get_Item_NestedCollection AND (r0."OptionalNested") = @entity_equality_get_Item_OptionalNested AND (r0."RequiredNested") = @entity_equality_get_Item_RequiredNested) +"""); + } + + #endregion Contains + + #region Value types + + public override async Task Nullable_value_type_with_null() + { + await base.Nullable_value_type_with_null(); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated", v."RelatedCollection", v."RequiredRelated" +FROM "ValueRootEntity" AS v +WHERE (v."OptionalRelated") IS NULL +"""); + } + + #endregion Value types + + [ConditionalFact] + public virtual void Check_all_tests_overridden() + => TestHelpers.AssertAllMethodsOverridden(GetType()); +} diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingMiscellaneousNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingMiscellaneousNpgsqlTest.cs similarity index 52% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingMiscellaneousNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingMiscellaneousNpgsqlTest.cs index 5571c3ad0a..1b16090f17 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingMiscellaneousNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingMiscellaneousNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexTableSplitting; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexTableSplitting; public class ComplexTableSplittingMiscellaneousNpgsqlTest( ComplexTableSplittingNpgsqlFixture fixture, @@ -44,6 +44,46 @@ public override async Task Where_nested_related_property() """); } + #region Value types + + public override async Task Where_property_on_non_nullable_value_type() + { + await base.Where_property_on_non_nullable_value_type(); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated_Id", v."OptionalRelated_Int", v."OptionalRelated_Name", v."OptionalRelated_String", v."OptionalRelated_OptionalNested_Id", v."OptionalRelated_OptionalNested_Int", v."OptionalRelated_OptionalNested_Name", v."OptionalRelated_OptionalNested_String", v."OptionalRelated_RequiredNested_Id", v."OptionalRelated_RequiredNested_Int", v."OptionalRelated_RequiredNested_Name", v."OptionalRelated_RequiredNested_String", v."RequiredRelated_Id", v."RequiredRelated_Int", v."RequiredRelated_Name", v."RequiredRelated_String", v."RequiredRelated_OptionalNested_Id", v."RequiredRelated_OptionalNested_Int", v."RequiredRelated_OptionalNested_Name", v."RequiredRelated_OptionalNested_String", v."RequiredRelated_RequiredNested_Id", v."RequiredRelated_RequiredNested_Int", v."RequiredRelated_RequiredNested_Name", v."RequiredRelated_RequiredNested_String" +FROM "ValueRootEntity" AS v +WHERE v."RequiredRelated_Int" = 8 +"""); + } + + public override async Task Where_property_on_nullable_value_type_Value() + { + await base.Where_property_on_nullable_value_type_Value(); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated_Id", v."OptionalRelated_Int", v."OptionalRelated_Name", v."OptionalRelated_String", v."OptionalRelated_OptionalNested_Id", v."OptionalRelated_OptionalNested_Int", v."OptionalRelated_OptionalNested_Name", v."OptionalRelated_OptionalNested_String", v."OptionalRelated_RequiredNested_Id", v."OptionalRelated_RequiredNested_Int", v."OptionalRelated_RequiredNested_Name", v."OptionalRelated_RequiredNested_String", v."RequiredRelated_Id", v."RequiredRelated_Int", v."RequiredRelated_Name", v."RequiredRelated_String", v."RequiredRelated_OptionalNested_Id", v."RequiredRelated_OptionalNested_Int", v."RequiredRelated_OptionalNested_Name", v."RequiredRelated_OptionalNested_String", v."RequiredRelated_RequiredNested_Id", v."RequiredRelated_RequiredNested_Int", v."RequiredRelated_RequiredNested_Name", v."RequiredRelated_RequiredNested_String" +FROM "ValueRootEntity" AS v +WHERE v."OptionalRelated_Int" = 8 +"""); + } + + public override async Task Where_HasValue_on_nullable_value_type() + { + await base.Where_HasValue_on_nullable_value_type(); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated_Id", v."OptionalRelated_Int", v."OptionalRelated_Name", v."OptionalRelated_String", v."OptionalRelated_OptionalNested_Id", v."OptionalRelated_OptionalNested_Int", v."OptionalRelated_OptionalNested_Name", v."OptionalRelated_OptionalNested_String", v."OptionalRelated_RequiredNested_Id", v."OptionalRelated_RequiredNested_Int", v."OptionalRelated_RequiredNested_Name", v."OptionalRelated_RequiredNested_String", v."RequiredRelated_Id", v."RequiredRelated_Int", v."RequiredRelated_Name", v."RequiredRelated_String", v."RequiredRelated_OptionalNested_Id", v."RequiredRelated_OptionalNested_Int", v."RequiredRelated_OptionalNested_Name", v."RequiredRelated_OptionalNested_String", v."RequiredRelated_RequiredNested_Id", v."RequiredRelated_RequiredNested_Int", v."RequiredRelated_RequiredNested_Name", v."RequiredRelated_RequiredNested_String" +FROM "ValueRootEntity" AS v +WHERE v."OptionalRelated_Id" IS NOT NULL +"""); + } + + #endregion Value types + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingNpgsqlFixture.cs similarity index 81% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingNpgsqlFixture.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingNpgsqlFixture.cs index 216962a66e..2896066e97 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingNpgsqlFixture.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexTableSplitting; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexTableSplitting; public class ComplexTableSplittingNpgsqlFixture : ComplexTableSplittingRelationalFixtureBase, ITestSqlLoggerFactory { diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingProjectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingProjectionNpgsqlTest.cs similarity index 79% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingProjectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingProjectionNpgsqlTest.cs index 2e1f73f051..53ba46bfd2 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingProjectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingProjectionNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexTableSplitting; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexTableSplitting; public class ComplexTableSplittingProjectionNpgsqlTest( ComplexTableSplittingNpgsqlFixture fixture, @@ -243,6 +243,57 @@ LIMIT 1 """); } + #region Value types + + public override async Task Select_root_with_value_types(QueryTrackingBehavior queryTrackingBehavior) + { + await base.Select_root_with_value_types(queryTrackingBehavior); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated_Id", v."OptionalRelated_Int", v."OptionalRelated_Name", v."OptionalRelated_String", v."OptionalRelated_OptionalNested_Id", v."OptionalRelated_OptionalNested_Int", v."OptionalRelated_OptionalNested_Name", v."OptionalRelated_OptionalNested_String", v."OptionalRelated_RequiredNested_Id", v."OptionalRelated_RequiredNested_Int", v."OptionalRelated_RequiredNested_Name", v."OptionalRelated_RequiredNested_String", v."RequiredRelated_Id", v."RequiredRelated_Int", v."RequiredRelated_Name", v."RequiredRelated_String", v."RequiredRelated_OptionalNested_Id", v."RequiredRelated_OptionalNested_Int", v."RequiredRelated_OptionalNested_Name", v."RequiredRelated_OptionalNested_String", v."RequiredRelated_RequiredNested_Id", v."RequiredRelated_RequiredNested_Int", v."RequiredRelated_RequiredNested_Name", v."RequiredRelated_RequiredNested_String" +FROM "ValueRootEntity" AS v +"""); + } + + public override async Task Select_non_nullable_value_type(QueryTrackingBehavior queryTrackingBehavior) + { + await base.Select_non_nullable_value_type(queryTrackingBehavior); + + AssertSql( + """ +SELECT v."RequiredRelated_Id", v."RequiredRelated_Int", v."RequiredRelated_Name", v."RequiredRelated_String", v."RequiredRelated_OptionalNested_Id", v."RequiredRelated_OptionalNested_Int", v."RequiredRelated_OptionalNested_Name", v."RequiredRelated_OptionalNested_String", v."RequiredRelated_RequiredNested_Id", v."RequiredRelated_RequiredNested_Int", v."RequiredRelated_RequiredNested_Name", v."RequiredRelated_RequiredNested_String" +FROM "ValueRootEntity" AS v +ORDER BY v."Id" NULLS FIRST +"""); + } + + public override async Task Select_nullable_value_type(QueryTrackingBehavior queryTrackingBehavior) + { + await base.Select_nullable_value_type(queryTrackingBehavior); + + AssertSql( + """ +SELECT v."OptionalRelated_Id", v."OptionalRelated_Int", v."OptionalRelated_Name", v."OptionalRelated_String", v."OptionalRelated_OptionalNested_Id", v."OptionalRelated_OptionalNested_Int", v."OptionalRelated_OptionalNested_Name", v."OptionalRelated_OptionalNested_String", v."OptionalRelated_RequiredNested_Id", v."OptionalRelated_RequiredNested_Int", v."OptionalRelated_RequiredNested_Name", v."OptionalRelated_RequiredNested_String" +FROM "ValueRootEntity" AS v +ORDER BY v."Id" NULLS FIRST +"""); + } + + public override async Task Select_nullable_value_type_with_Value(QueryTrackingBehavior queryTrackingBehavior) + { + await base.Select_nullable_value_type_with_Value(queryTrackingBehavior); + + AssertSql( + """ +SELECT v."OptionalRelated_Id", v."OptionalRelated_Int", v."OptionalRelated_Name", v."OptionalRelated_String", v."OptionalRelated_OptionalNested_Id", v."OptionalRelated_OptionalNested_Int", v."OptionalRelated_OptionalNested_Name", v."OptionalRelated_OptionalNested_String", v."OptionalRelated_RequiredNested_Id", v."OptionalRelated_RequiredNested_Int", v."OptionalRelated_RequiredNested_Name", v."OptionalRelated_RequiredNested_String" +FROM "ValueRootEntity" AS v +ORDER BY v."Id" NULLS FIRST +"""); + } + + #endregion Value types + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingStructuralEqualityNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingStructuralEqualityNpgsqlTest.cs similarity index 87% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingStructuralEqualityNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingStructuralEqualityNpgsqlTest.cs index 8375649120..ffd2e23b53 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexTableSplitting/ComplexTableSplittingStructuralEqualityNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingStructuralEqualityNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexTableSplitting; +namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexTableSplitting; public class ComplexTableSplittingStructuralEqualityNpgsqlTest( ComplexTableSplittingNpgsqlFixture fixture, @@ -130,6 +130,54 @@ public override async Task Nested_collection_with_parameter() AssertSql(); } + #region Contains + + public override async Task Contains_with_inline() + { + await base.Contains_with_inline(); + + AssertSql(); + } + + public override async Task Contains_with_parameter() + { + await base.Contains_with_parameter(); + + AssertSql(); + } + + public override async Task Contains_with_operators_composed_on_the_collection() + { + await base.Contains_with_operators_composed_on_the_collection(); + + AssertSql(); + } + + public override async Task Contains_with_nested_and_composed_operators() + { + await base.Contains_with_nested_and_composed_operators(); + + AssertSql(); + } + + #endregion Contains + + #region Value types + + public override async Task Nullable_value_type_with_null() + { + await base.Nullable_value_type_with_null(); + + AssertSql( + """ +SELECT v."Id", v."Name", v."OptionalRelated_Id", v."OptionalRelated_Int", v."OptionalRelated_Name", v."OptionalRelated_String", v."OptionalRelated_OptionalNested_Id", v."OptionalRelated_OptionalNested_Int", v."OptionalRelated_OptionalNested_Name", v."OptionalRelated_OptionalNested_String", v."OptionalRelated_RequiredNested_Id", v."OptionalRelated_RequiredNested_Int", v."OptionalRelated_RequiredNested_Name", v."OptionalRelated_RequiredNested_String", v."RequiredRelated_Id", v."RequiredRelated_Int", v."RequiredRelated_Name", v."RequiredRelated_String", v."RequiredRelated_OptionalNested_Id", v."RequiredRelated_OptionalNested_Int", v."RequiredRelated_OptionalNested_Name", v."RequiredRelated_OptionalNested_String", v."RequiredRelated_RequiredNested_Id", v."RequiredRelated_RequiredNested_Int", v."RequiredRelated_RequiredNested_Name", v."RequiredRelated_RequiredNested_String" +FROM "ValueRootEntity" AS v +WHERE v."OptionalRelated_Id" IS NULL +"""); + } + + #endregion Value types + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsCollectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionNpgsqlTest.cs similarity index 99% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsCollectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionNpgsqlTest.cs index d709986943..d14120d3c3 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsCollectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.Navigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.Navigations; public class NavigationsCollectionNpgsqlTest(NavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : NavigationsCollectionRelationalTestBase(fixture, testOutputHelper) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsIncludeNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsIncludeNpgsqlTest.cs similarity index 99% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsIncludeNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsIncludeNpgsqlTest.cs index 4140557862..b53f940dbe 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsIncludeNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsIncludeNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.Navigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.Navigations; public class NavigationsIncludeNpgsqlTest(NavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : NavigationsIncludeRelationalTestBase(fixture, testOutputHelper) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsMiscellaneousNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsMiscellaneousNpgsqlTest.cs similarity index 99% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsMiscellaneousNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsMiscellaneousNpgsqlTest.cs index f283d2333b..bed3848054 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsMiscellaneousNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsMiscellaneousNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.Navigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.Navigations; public class NavigationsMiscellaneousNpgsqlTest( NavigationsNpgsqlFixture fixture, diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsNpgsqlFixture.cs similarity index 81% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsNpgsqlFixture.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsNpgsqlFixture.cs index e0153c1d13..604fad94c0 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsNpgsqlFixture.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.Navigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.Navigations; public class NavigationsNpgsqlFixture : NavigationsRelationalFixtureBase { diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsProjectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsProjectionNpgsqlTest.cs similarity index 99% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsProjectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsProjectionNpgsqlTest.cs index 593f509f45..81bc25fd2b 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsProjectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsProjectionNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.Navigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.Navigations; public class NavigationsProjectionNpgsqlTest(NavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : NavigationsProjectionRelationalTestBase(fixture, testOutputHelper) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsSetOperationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsSetOperationsNpgsqlTest.cs similarity index 99% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsSetOperationsNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsSetOperationsNpgsqlTest.cs index d27b588183..03c98ac145 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsSetOperationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsSetOperationsNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.Navigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.Navigations; public class NavigationsSetOperationsNpgsqlTest( NavigationsNpgsqlFixture fixture, diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsStructuralEqualityNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsStructuralEqualityNpgsqlTest.cs similarity index 68% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsStructuralEqualityNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsStructuralEqualityNpgsqlTest.cs index 1fb18b73c9..401206d4a1 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/Navigations/NavigationsStructuralEqualityNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsStructuralEqualityNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.Navigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.Navigations; public class NavigationsStructuralEqualityNpgsqlTest( NavigationsNpgsqlFixture fixture, @@ -276,6 +276,142 @@ public override async Task Nested_collection_with_parameter() AssertSql(); } + #region Contains + + public override async Task Contains_with_inline() + { + await base.Contains_with_inline(); + + AssertSql( + """ +SELECT r."Id", r."Name", r."OptionalRelatedId", r."RequiredRelatedId", r1."Id", r1."CollectionRootId", r1."Int", r1."Name", r1."OptionalNestedId", r1."RequiredNestedId", r1."String", r0."Id", n0."Id", n1."Id", n2."Id", n3."Id", n4."Id", n4."CollectionRelatedId", n4."Int", n4."Name", n4."String", n0."CollectionRelatedId", n0."Int", n0."Name", n0."String", n1."CollectionRelatedId", n1."Int", n1."Name", n1."String", s."Id", s."CollectionRootId", s."Int", s."Name", s."OptionalNestedId", s."RequiredNestedId", s."String", s."Id0", s."Id1", s."Id2", s."CollectionRelatedId", s."Int0", s."Name0", s."String0", s."CollectionRelatedId0", s."Int1", s."Name1", s."String1", s."CollectionRelatedId1", s."Int2", s."Name2", s."String2", r0."CollectionRootId", r0."Int", r0."Name", r0."OptionalNestedId", r0."RequiredNestedId", r0."String", n8."Id", n8."CollectionRelatedId", n8."Int", n8."Name", n8."String", n2."CollectionRelatedId", n2."Int", n2."Name", n2."String", n3."CollectionRelatedId", n3."Int", n3."Name", n3."String" +FROM "RootEntity" AS r +INNER JOIN "RelatedType" AS r0 ON r."RequiredRelatedId" = r0."Id" +LEFT JOIN "RelatedType" AS r1 ON r."OptionalRelatedId" = r1."Id" +LEFT JOIN "NestedType" AS n0 ON r1."OptionalNestedId" = n0."Id" +LEFT JOIN "NestedType" AS n1 ON r1."RequiredNestedId" = n1."Id" +LEFT JOIN "NestedType" AS n2 ON r0."OptionalNestedId" = n2."Id" +INNER JOIN "NestedType" AS n3 ON r0."RequiredNestedId" = n3."Id" +LEFT JOIN "NestedType" AS n4 ON r1."Id" = n4."CollectionRelatedId" +LEFT JOIN ( + SELECT r2."Id", r2."CollectionRootId", r2."Int", r2."Name", r2."OptionalNestedId", r2."RequiredNestedId", r2."String", n5."Id" AS "Id0", n6."Id" AS "Id1", n7."Id" AS "Id2", n7."CollectionRelatedId", n7."Int" AS "Int0", n7."Name" AS "Name0", n7."String" AS "String0", n5."CollectionRelatedId" AS "CollectionRelatedId0", n5."Int" AS "Int1", n5."Name" AS "Name1", n5."String" AS "String1", n6."CollectionRelatedId" AS "CollectionRelatedId1", n6."Int" AS "Int2", n6."Name" AS "Name2", n6."String" AS "String2" + FROM "RelatedType" AS r2 + LEFT JOIN "NestedType" AS n5 ON r2."OptionalNestedId" = n5."Id" + INNER JOIN "NestedType" AS n6 ON r2."RequiredNestedId" = n6."Id" + LEFT JOIN "NestedType" AS n7 ON r2."Id" = n7."CollectionRelatedId" +) AS s ON r."Id" = s."CollectionRootId" +LEFT JOIN "NestedType" AS n8 ON r0."Id" = n8."CollectionRelatedId" +WHERE EXISTS ( + SELECT 1 + FROM "NestedType" AS n + WHERE r0."Id" = n."CollectionRelatedId" AND n."Id" = 1002) +ORDER BY r."Id" NULLS FIRST, r0."Id" NULLS FIRST, r1."Id" NULLS FIRST, n0."Id" NULLS FIRST, n1."Id" NULLS FIRST, n2."Id" NULLS FIRST, n3."Id" NULLS FIRST, n4."Id" NULLS FIRST, s."Id" NULLS FIRST, s."Id0" NULLS FIRST, s."Id1" NULLS FIRST, s."Id2" NULLS FIRST +"""); + } + + public override async Task Contains_with_parameter() + { + await base.Contains_with_parameter(); + + AssertSql( + """ +@entity_equality_nested_Id='1002' (Nullable = true) + +SELECT r."Id", r."Name", r."OptionalRelatedId", r."RequiredRelatedId", r1."Id", r1."CollectionRootId", r1."Int", r1."Name", r1."OptionalNestedId", r1."RequiredNestedId", r1."String", r0."Id", n0."Id", n1."Id", n2."Id", n3."Id", n4."Id", n4."CollectionRelatedId", n4."Int", n4."Name", n4."String", n0."CollectionRelatedId", n0."Int", n0."Name", n0."String", n1."CollectionRelatedId", n1."Int", n1."Name", n1."String", s."Id", s."CollectionRootId", s."Int", s."Name", s."OptionalNestedId", s."RequiredNestedId", s."String", s."Id0", s."Id1", s."Id2", s."CollectionRelatedId", s."Int0", s."Name0", s."String0", s."CollectionRelatedId0", s."Int1", s."Name1", s."String1", s."CollectionRelatedId1", s."Int2", s."Name2", s."String2", r0."CollectionRootId", r0."Int", r0."Name", r0."OptionalNestedId", r0."RequiredNestedId", r0."String", n8."Id", n8."CollectionRelatedId", n8."Int", n8."Name", n8."String", n2."CollectionRelatedId", n2."Int", n2."Name", n2."String", n3."CollectionRelatedId", n3."Int", n3."Name", n3."String" +FROM "RootEntity" AS r +INNER JOIN "RelatedType" AS r0 ON r."RequiredRelatedId" = r0."Id" +LEFT JOIN "RelatedType" AS r1 ON r."OptionalRelatedId" = r1."Id" +LEFT JOIN "NestedType" AS n0 ON r1."OptionalNestedId" = n0."Id" +LEFT JOIN "NestedType" AS n1 ON r1."RequiredNestedId" = n1."Id" +LEFT JOIN "NestedType" AS n2 ON r0."OptionalNestedId" = n2."Id" +INNER JOIN "NestedType" AS n3 ON r0."RequiredNestedId" = n3."Id" +LEFT JOIN "NestedType" AS n4 ON r1."Id" = n4."CollectionRelatedId" +LEFT JOIN ( + SELECT r2."Id", r2."CollectionRootId", r2."Int", r2."Name", r2."OptionalNestedId", r2."RequiredNestedId", r2."String", n5."Id" AS "Id0", n6."Id" AS "Id1", n7."Id" AS "Id2", n7."CollectionRelatedId", n7."Int" AS "Int0", n7."Name" AS "Name0", n7."String" AS "String0", n5."CollectionRelatedId" AS "CollectionRelatedId0", n5."Int" AS "Int1", n5."Name" AS "Name1", n5."String" AS "String1", n6."CollectionRelatedId" AS "CollectionRelatedId1", n6."Int" AS "Int2", n6."Name" AS "Name2", n6."String" AS "String2" + FROM "RelatedType" AS r2 + LEFT JOIN "NestedType" AS n5 ON r2."OptionalNestedId" = n5."Id" + INNER JOIN "NestedType" AS n6 ON r2."RequiredNestedId" = n6."Id" + LEFT JOIN "NestedType" AS n7 ON r2."Id" = n7."CollectionRelatedId" +) AS s ON r."Id" = s."CollectionRootId" +LEFT JOIN "NestedType" AS n8 ON r0."Id" = n8."CollectionRelatedId" +WHERE EXISTS ( + SELECT 1 + FROM "NestedType" AS n + WHERE r0."Id" = n."CollectionRelatedId" AND n."Id" = @entity_equality_nested_Id) +ORDER BY r."Id" NULLS FIRST, r0."Id" NULLS FIRST, r1."Id" NULLS FIRST, n0."Id" NULLS FIRST, n1."Id" NULLS FIRST, n2."Id" NULLS FIRST, n3."Id" NULLS FIRST, n4."Id" NULLS FIRST, s."Id" NULLS FIRST, s."Id0" NULLS FIRST, s."Id1" NULLS FIRST, s."Id2" NULLS FIRST +"""); + } + + public override async Task Contains_with_operators_composed_on_the_collection() + { + await base.Contains_with_operators_composed_on_the_collection(); + + AssertSql( + """ +@get_Item_Int='103' +@entity_equality_get_Item_Id='3003' (Nullable = true) + +SELECT r."Id", r."Name", r."OptionalRelatedId", r."RequiredRelatedId", r1."Id", r1."CollectionRootId", r1."Int", r1."Name", r1."OptionalNestedId", r1."RequiredNestedId", r1."String", r0."Id", n0."Id", n1."Id", n2."Id", n3."Id", n4."Id", n4."CollectionRelatedId", n4."Int", n4."Name", n4."String", n0."CollectionRelatedId", n0."Int", n0."Name", n0."String", n1."CollectionRelatedId", n1."Int", n1."Name", n1."String", s."Id", s."CollectionRootId", s."Int", s."Name", s."OptionalNestedId", s."RequiredNestedId", s."String", s."Id0", s."Id1", s."Id2", s."CollectionRelatedId", s."Int0", s."Name0", s."String0", s."CollectionRelatedId0", s."Int1", s."Name1", s."String1", s."CollectionRelatedId1", s."Int2", s."Name2", s."String2", r0."CollectionRootId", r0."Int", r0."Name", r0."OptionalNestedId", r0."RequiredNestedId", r0."String", n8."Id", n8."CollectionRelatedId", n8."Int", n8."Name", n8."String", n2."CollectionRelatedId", n2."Int", n2."Name", n2."String", n3."CollectionRelatedId", n3."Int", n3."Name", n3."String" +FROM "RootEntity" AS r +INNER JOIN "RelatedType" AS r0 ON r."RequiredRelatedId" = r0."Id" +LEFT JOIN "RelatedType" AS r1 ON r."OptionalRelatedId" = r1."Id" +LEFT JOIN "NestedType" AS n0 ON r1."OptionalNestedId" = n0."Id" +LEFT JOIN "NestedType" AS n1 ON r1."RequiredNestedId" = n1."Id" +LEFT JOIN "NestedType" AS n2 ON r0."OptionalNestedId" = n2."Id" +INNER JOIN "NestedType" AS n3 ON r0."RequiredNestedId" = n3."Id" +LEFT JOIN "NestedType" AS n4 ON r1."Id" = n4."CollectionRelatedId" +LEFT JOIN ( + SELECT r2."Id", r2."CollectionRootId", r2."Int", r2."Name", r2."OptionalNestedId", r2."RequiredNestedId", r2."String", n5."Id" AS "Id0", n6."Id" AS "Id1", n7."Id" AS "Id2", n7."CollectionRelatedId", n7."Int" AS "Int0", n7."Name" AS "Name0", n7."String" AS "String0", n5."CollectionRelatedId" AS "CollectionRelatedId0", n5."Int" AS "Int1", n5."Name" AS "Name1", n5."String" AS "String1", n6."CollectionRelatedId" AS "CollectionRelatedId1", n6."Int" AS "Int2", n6."Name" AS "Name2", n6."String" AS "String2" + FROM "RelatedType" AS r2 + LEFT JOIN "NestedType" AS n5 ON r2."OptionalNestedId" = n5."Id" + INNER JOIN "NestedType" AS n6 ON r2."RequiredNestedId" = n6."Id" + LEFT JOIN "NestedType" AS n7 ON r2."Id" = n7."CollectionRelatedId" +) AS s ON r."Id" = s."CollectionRootId" +LEFT JOIN "NestedType" AS n8 ON r0."Id" = n8."CollectionRelatedId" +WHERE EXISTS ( + SELECT 1 + FROM "NestedType" AS n + WHERE r0."Id" = n."CollectionRelatedId" AND n."Int" > @get_Item_Int AND n."Id" = @entity_equality_get_Item_Id) +ORDER BY r."Id" NULLS FIRST, r0."Id" NULLS FIRST, r1."Id" NULLS FIRST, n0."Id" NULLS FIRST, n1."Id" NULLS FIRST, n2."Id" NULLS FIRST, n3."Id" NULLS FIRST, n4."Id" NULLS FIRST, s."Id" NULLS FIRST, s."Id0" NULLS FIRST, s."Id1" NULLS FIRST, s."Id2" NULLS FIRST +"""); + } + + public override async Task Contains_with_nested_and_composed_operators() + { + await base.Contains_with_nested_and_composed_operators(); + + AssertSql( + """ +@get_Item_Id='302' +@entity_equality_get_Item_Id='303' (Nullable = true) + +SELECT r."Id", r."Name", r."OptionalRelatedId", r."RequiredRelatedId", r1."Id", r1."CollectionRootId", r1."Int", r1."Name", r1."OptionalNestedId", r1."RequiredNestedId", r1."String", n."Id", n0."Id", r2."Id", n1."Id", n2."Id", n3."Id", n3."CollectionRelatedId", n3."Int", n3."Name", n3."String", n."CollectionRelatedId", n."Int", n."Name", n."String", n0."CollectionRelatedId", n0."Int", n0."Name", n0."String", s."Id", s."CollectionRootId", s."Int", s."Name", s."OptionalNestedId", s."RequiredNestedId", s."String", s."Id0", s."Id1", s."Id2", s."CollectionRelatedId", s."Int0", s."Name0", s."String0", s."CollectionRelatedId0", s."Int1", s."Name1", s."String1", s."CollectionRelatedId1", s."Int2", s."Name2", s."String2", r2."CollectionRootId", r2."Int", r2."Name", r2."OptionalNestedId", r2."RequiredNestedId", r2."String", n7."Id", n7."CollectionRelatedId", n7."Int", n7."Name", n7."String", n1."CollectionRelatedId", n1."Int", n1."Name", n1."String", n2."CollectionRelatedId", n2."Int", n2."Name", n2."String" +FROM "RootEntity" AS r +LEFT JOIN "RelatedType" AS r1 ON r."OptionalRelatedId" = r1."Id" +LEFT JOIN "NestedType" AS n ON r1."OptionalNestedId" = n."Id" +LEFT JOIN "NestedType" AS n0 ON r1."RequiredNestedId" = n0."Id" +INNER JOIN "RelatedType" AS r2 ON r."RequiredRelatedId" = r2."Id" +LEFT JOIN "NestedType" AS n1 ON r2."OptionalNestedId" = n1."Id" +INNER JOIN "NestedType" AS n2 ON r2."RequiredNestedId" = n2."Id" +LEFT JOIN "NestedType" AS n3 ON r1."Id" = n3."CollectionRelatedId" +LEFT JOIN ( + SELECT r3."Id", r3."CollectionRootId", r3."Int", r3."Name", r3."OptionalNestedId", r3."RequiredNestedId", r3."String", n4."Id" AS "Id0", n5."Id" AS "Id1", n6."Id" AS "Id2", n6."CollectionRelatedId", n6."Int" AS "Int0", n6."Name" AS "Name0", n6."String" AS "String0", n4."CollectionRelatedId" AS "CollectionRelatedId0", n4."Int" AS "Int1", n4."Name" AS "Name1", n4."String" AS "String1", n5."CollectionRelatedId" AS "CollectionRelatedId1", n5."Int" AS "Int2", n5."Name" AS "Name2", n5."String" AS "String2" + FROM "RelatedType" AS r3 + LEFT JOIN "NestedType" AS n4 ON r3."OptionalNestedId" = n4."Id" + INNER JOIN "NestedType" AS n5 ON r3."RequiredNestedId" = n5."Id" + LEFT JOIN "NestedType" AS n6 ON r3."Id" = n6."CollectionRelatedId" +) AS s ON r."Id" = s."CollectionRootId" +LEFT JOIN "NestedType" AS n7 ON r2."Id" = n7."CollectionRelatedId" +WHERE EXISTS ( + SELECT 1 + FROM "RelatedType" AS r0 + WHERE r."Id" = r0."CollectionRootId" AND r0."Id" > @get_Item_Id AND r0."Id" = @entity_equality_get_Item_Id) +ORDER BY r."Id" NULLS FIRST, r1."Id" NULLS FIRST, n."Id" NULLS FIRST, n0."Id" NULLS FIRST, r2."Id" NULLS FIRST, n1."Id" NULLS FIRST, n2."Id" NULLS FIRST, n3."Id" NULLS FIRST, s."Id" NULLS FIRST, s."Id0" NULLS FIRST, s."Id1" NULLS FIRST, s."Id2" NULLS FIRST +"""); + } + + #endregion Contains + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs similarity index 98% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs index 415b4bb264..66ce2c6d49 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedJson; public class OwnedJsonCollectionNpgsqlTest(OwnedJsonNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedJsonCollectionRelationalTestBase(fixture, testOutputHelper) @@ -159,7 +159,7 @@ public override async Task Index_parameter() AssertSql( """ -@i='?' (DbType = Int32) +@i='0' SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" FROM "RootEntity" AS r diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonMiscellaneousNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonMiscellaneousNpgsqlTest.cs similarity index 95% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonMiscellaneousNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonMiscellaneousNpgsqlTest.cs index a8f6d8575a..38fde676dd 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonMiscellaneousNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonMiscellaneousNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedJson; public class OwnedJsonMiscellaneousNpgsqlTest( OwnedJsonNpgsqlFixture fixture, diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonNpgsqlFixture.cs similarity index 81% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonNpgsqlFixture.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonNpgsqlFixture.cs index e5ac0e1c64..0aaf845cfc 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonNpgsqlFixture.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedJson; public class OwnedJsonNpgsqlFixture : OwnedJsonRelationalFixtureBase { diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonProjectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonProjectionNpgsqlTest.cs similarity index 99% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonProjectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonProjectionNpgsqlTest.cs index 5617daa84a..d703a7e1c3 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonProjectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonProjectionNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedJson; public class OwnedJsonProjectionNpgsqlTest(OwnedJsonNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedJsonProjectionRelationalTestBase(fixture, testOutputHelper) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonStructuralEqualityNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonStructuralEqualityNpgsqlTest.cs similarity index 80% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonStructuralEqualityNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonStructuralEqualityNpgsqlTest.cs index 78c37426a9..766096ef0e 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonStructuralEqualityNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonStructuralEqualityNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedJson; public class OwnedJsonStructuralEqualityNpgsqlTest( OwnedJsonNpgsqlFixture fixture, @@ -120,6 +120,38 @@ public override async Task Nested_collection_with_parameter() AssertSql(); } + #region Contains + + public override async Task Contains_with_inline() + { + await base.Contains_with_inline(); + + AssertSql(); + } + + public override async Task Contains_with_parameter() + { + await base.Contains_with_parameter(); + + AssertSql(); + } + + public override async Task Contains_with_operators_composed_on_the_collection() + { + await base.Contains_with_operators_composed_on_the_collection(); + + AssertSql(); + } + + public override async Task Contains_with_nested_and_composed_operators() + { + await base.Contains_with_nested_and_composed_operators(); + + AssertSql(); + } + + #endregion Contains + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonTypeNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonTypeNpgsqlFixture.cs similarity index 92% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonTypeNpgsqlFixture.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonTypeNpgsqlFixture.cs index 1f24f1c32b..118d582edb 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedJson/OwnedJsonTypeNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonTypeNpgsqlFixture.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedJson; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedJson; public class OwnedJsonTypeNpgsqlFixture : OwnedJsonRelationalFixtureBase { diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs similarity index 98% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs index 2de2ba1394..cec5cdda5d 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedNavigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedNavigations; -// TODO: Unskip (remove abstract) for 10.0.0-rc.2, https://github.com/dotnet/efcore/pull/36595 -public abstract class OwnedNavigationsCollectionNpgsqlTest(OwnedNavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) +public class OwnedNavigationsCollectionNpgsqlTest(OwnedNavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedNavigationsCollectionRelationalTestBase(fixture, testOutputHelper) { public override async Task Count() diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsMiscellaneousNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsMiscellaneousNpgsqlTest.cs similarity index 97% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsMiscellaneousNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsMiscellaneousNpgsqlTest.cs index fa1c4d74aa..8c35b0437d 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsMiscellaneousNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsMiscellaneousNpgsqlTest.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedNavigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedNavigations; -// TODO: Unskip (remove abstract) for 10.0.0-rc.2, https://github.com/dotnet/efcore/pull/36595 -public abstract class OwnedNavigationsMiscellaneousNpgsqlTest( +public class OwnedNavigationsMiscellaneousNpgsqlTest( OwnedNavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedNavigationsMiscellaneousRelationalTestBase(fixture, testOutputHelper) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsNpgsqlFixture.cs similarity index 80% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsNpgsqlFixture.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsNpgsqlFixture.cs index 9b9fbcf5da..4a589a0f9e 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsNpgsqlFixture.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedNavigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedNavigations; public class OwnedNavigationsNpgsqlFixture : OwnedNavigationsRelationalFixtureBase { diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsProjectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsProjectionNpgsqlTest.cs similarity index 98% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsProjectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsProjectionNpgsqlTest.cs index 8777f5686b..ae7ced81ea 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsProjectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsProjectionNpgsqlTest.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedNavigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedNavigations; -// TODO: Unskip (remove abstract) for 10.0.0-rc.2, https://github.com/dotnet/efcore/pull/36595 -public abstract class OwnedNavigationsProjectionNpgsqlTest(OwnedNavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) +public class OwnedNavigationsProjectionNpgsqlTest(OwnedNavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedNavigationsProjectionRelationalTestBase(fixture, testOutputHelper) { public override async Task Select_root(QueryTrackingBehavior queryTrackingBehavior) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsSetOperationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsSetOperationsNpgsqlTest.cs similarity index 99% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsSetOperationsNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsSetOperationsNpgsqlTest.cs index a7272498e1..be3a729f9a 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsSetOperationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsSetOperationsNpgsqlTest.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedNavigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedNavigations; public class OwnedNavigationsSetOperationsNpgsqlTest( OwnedNavigationsNpgsqlFixture fixture, diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsStructuralEqualityNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsStructuralEqualityNpgsqlTest.cs similarity index 96% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsStructuralEqualityNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsStructuralEqualityNpgsqlTest.cs index 33791c6b02..5ba7c6050a 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedNavigations/OwnedNavigationsStructuralEqualityNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsStructuralEqualityNpgsqlTest.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedNavigations; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedNavigations; -// TODO: Unskip (remove abstract) for 10.0.0-rc.2, https://github.com/dotnet/efcore/pull/36595 -public abstract class OwnedNavigationsStructuralEqualityNpgsqlTest( +public class OwnedNavigationsStructuralEqualityNpgsqlTest( OwnedNavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedNavigationsStructuralEqualityRelationalTestBase(fixture, testOutputHelper) @@ -235,6 +234,38 @@ public override async Task Nested_collection_with_parameter() AssertSql(); } + #region Contains + + public override async Task Contains_with_inline() + { + await base.Contains_with_inline(); + + AssertSql(); + } + + public override async Task Contains_with_parameter() + { + await base.Contains_with_parameter(); + + AssertSql(); + } + + public override async Task Contains_with_operators_composed_on_the_collection() + { + await base.Contains_with_operators_composed_on_the_collection(); + + AssertSql(); + } + + public override async Task Contains_with_nested_and_composed_operators() + { + await base.Contains_with_nested_and_composed_operators(); + + AssertSql(); + } + + #endregion Contains + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingMiscellaneousNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingMiscellaneousNpgsqlTest.cs similarity index 97% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingMiscellaneousNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingMiscellaneousNpgsqlTest.cs index 1b73aae1c0..cb28b46d6d 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingMiscellaneousNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingMiscellaneousNpgsqlTest.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedTableSplitting; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedTableSplitting; -// TODO: Unskip (remove abstract) for 10.0.0-rc.2, https://github.com/dotnet/efcore/pull/36595 -public abstract class OwnedTableSplittingMiscellaneousNpgsqlTest( +public class OwnedTableSplittingMiscellaneousNpgsqlTest( OwnedTableSplittingNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedTableSplittingMiscellaneousRelationalTestBase(fixture, testOutputHelper) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingNpgsqlFixture.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingNpgsqlFixture.cs similarity index 80% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingNpgsqlFixture.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingNpgsqlFixture.cs index 58e2bb8be7..a71da6f46b 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingNpgsqlFixture.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingNpgsqlFixture.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedTableSplitting; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedTableSplitting; public class OwnedTableSplittingNpgsqlFixture : OwnedTableSplittingRelationalFixtureBase { diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingProjectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingProjectionNpgsqlTest.cs similarity index 98% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingProjectionNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingProjectionNpgsqlTest.cs index c86a12b510..83752a28f3 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingProjectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingProjectionNpgsqlTest.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedTableSplitting; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedTableSplitting; -// TODO: Unskip (remove abstract) for 10.0.0-rc.2, https://github.com/dotnet/efcore/pull/36595 -public abstract class OwnedTableSplittingProjectionNpgsqlTest(OwnedTableSplittingNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) +public class OwnedTableSplittingProjectionNpgsqlTest(OwnedTableSplittingNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedTableSplittingProjectionRelationalTestBase(fixture, testOutputHelper) { public override async Task Select_root(QueryTrackingBehavior queryTrackingBehavior) diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingStructuralEqualityNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingStructuralEqualityNpgsqlTest.cs similarity index 96% rename from test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingStructuralEqualityNpgsqlTest.cs rename to test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingStructuralEqualityNpgsqlTest.cs index fc000c6901..478a482a22 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/OwnedTableSplitting/OwnedTableSplittingStructuralEqualityNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingStructuralEqualityNpgsqlTest.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Microsoft.EntityFrameworkCore.Query.Relationships.OwnedTableSplitting; +namespace Microsoft.EntityFrameworkCore.Query.Associations.OwnedTableSplitting; -// TODO: Unskip (remove abstract) for 10.0.0-rc.2, https://github.com/dotnet/efcore/pull/36595 -public abstract class OwnedTableSplittingStructuralEqualityNpgsqlTest( +public class OwnedTableSplittingStructuralEqualityNpgsqlTest( OwnedTableSplittingNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) : OwnedTableSplittingStructuralEqualityRelationalTestBase(fixture, testOutputHelper) @@ -195,6 +194,38 @@ public override async Task Nested_collection_with_parameter() AssertSql(); } + #region Contains + + public override async Task Contains_with_inline() + { + await base.Contains_with_inline(); + + AssertSql(); + } + + public override async Task Contains_with_parameter() + { + await base.Contains_with_parameter(); + + AssertSql(); + } + + public override async Task Contains_with_operators_composed_on_the_collection() + { + await base.Contains_with_operators_composed_on_the_collection(); + + AssertSql(); + } + + public override async Task Contains_with_nested_and_composed_operators() + { + await base.Contains_with_nested_and_composed_operators(); + + AssertSql(); + } + + #endregion Contains + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType()); diff --git a/test/EFCore.PG.FunctionalTests/Query/ComplexTypeQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/ComplexTypeQueryNpgsqlTest.cs index 96ba32fe2f..73559df0f1 100644 --- a/test/EFCore.PG.FunctionalTests/Query/ComplexTypeQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/ComplexTypeQueryNpgsqlTest.cs @@ -205,7 +205,8 @@ public override async Task Complex_type_equals_parameter(bool async) AssertSql( """ @entity_equality_address_AddressLine1='804 S. Lakeshore Road' -@entity_equality_address_Tags={ 'foo', 'bar' } (DbType = Object) +@entity_equality_address_Tags={ 'foo' +'bar' } (DbType = Object) @entity_equality_address_ZipCode='38654' (Nullable = true) @entity_equality_address_Country_Code='US' @entity_equality_address_Country_FullName='United States' @@ -230,7 +231,8 @@ public override async Task Contains_over_complex_type(bool async) AssertSql( """ @entity_equality_address_AddressLine1='804 S. Lakeshore Road' -@entity_equality_address_Tags={ 'foo', 'bar' } (DbType = Object) +@entity_equality_address_Tags={ 'foo' +'bar' } (DbType = Object) @entity_equality_address_ZipCode='38654' (Nullable = true) @entity_equality_address_Country_Code='US' @entity_equality_address_Country_FullName='United States' diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs index 2e6d826e15..12965bffe1 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs @@ -51,7 +51,8 @@ public override async Task Contains_with_local_uint_array_closure(bool async) // Note: PostgreSQL doesn't support uint, but value converters make this into bigint AssertSql( """ -@ids={ '0', '1' } (DbType = Object) +@ids={ '0' +'1' } (DbType = Object) SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title" FROM "Employees" AS e @@ -75,7 +76,8 @@ public override async Task Contains_with_local_nullable_uint_array_closure(bool AssertSql( """ -@ids={ '0', '1' } (DbType = Object) +@ids={ '0' +'1' } (DbType = Object) SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title" FROM "Employees" AS e @@ -114,7 +116,8 @@ public override async Task Contains_with_local_enumerable_inline_closure_mix(boo AssertSql( """ -@p={ 'ABCDE', 'ALFKI' } (DbType = Object) +@p={ 'ABCDE' +'ALFKI' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -122,7 +125,8 @@ public override async Task Contains_with_local_enumerable_inline_closure_mix(boo """, // """ -@p={ 'ABCDE', 'ANATR' } (DbType = Object) +@p={ 'ABCDE' +'ANATR' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -136,7 +140,8 @@ public override async Task Contains_with_local_non_primitive_list_closure_mix(bo AssertSql( """ -@Select={ 'ABCDE', 'ALFKI' } (DbType = Object) +@Select={ 'ABCDE' +'ALFKI' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -150,7 +155,8 @@ public override async Task Contains_with_local_non_primitive_list_inline_closure AssertSql( """ -@Select={ 'ABCDE', 'ALFKI' } (DbType = Object) +@Select={ 'ABCDE' +'ALFKI' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -158,7 +164,8 @@ public override async Task Contains_with_local_non_primitive_list_inline_closure """, // """ -@Select={ 'ABCDE', 'ANATR' } (DbType = Object) +@Select={ 'ABCDE' +'ANATR' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindMiscellaneousQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindMiscellaneousQueryNpgsqlTest.cs index d4d4eca64b..68c5db3d0d 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindMiscellaneousQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindMiscellaneousQueryNpgsqlTest.cs @@ -245,7 +245,8 @@ await AssertQuery( // (see https://github.com/aspnet/EntityFrameworkCore/issues/17598). AssertSql( """ -@regions={ 'UK', 'SP' } (DbType = Object) +@regions={ 'UK' +'SP' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -269,7 +270,9 @@ await AssertQuery( // (see https://github.com/aspnet/EntityFrameworkCore/issues/17598). AssertSql( """ -@regions={ 'UK', 'SP', NULL } (DbType = Object) +@regions={ 'UK' +'SP' +NULL } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -319,7 +322,9 @@ public async Task Array_Any_Like(bool async) AssertSql( """ -@collection={ 'A%', 'B%', 'C%' } (DbType = Object) +@collection={ 'A%' +'B%' +'C%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -341,7 +346,9 @@ public async Task Array_All_Like(bool async) AssertSql( """ -@collection={ 'A%', 'B%', 'C%' } (DbType = Object) +@collection={ 'A%' +'B%' +'C%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -363,7 +370,9 @@ public async Task Array_All_Like_negated(bool async) AssertSql( """ -@collection={ 'A%', 'B%', 'C%' } (DbType = Object) +@collection={ 'A%' +'B%' +'C%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -409,7 +418,9 @@ public async Task Array_Any_ILike(bool async) AssertSql( """ -@collection={ 'a%', 'b%', 'c%' } (DbType = Object) +@collection={ 'a%' +'b%' +'c%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -438,7 +449,9 @@ public async Task Array_Any_ILike_negated(bool async) AssertSql( """ -@collection={ 'a%', 'b%', 'c%' } (DbType = Object) +@collection={ 'a%' +'b%' +'c%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c @@ -460,7 +473,9 @@ public async Task Array_All_ILike(bool async) AssertSql( """ -@collection={ 'a%', 'b%', 'c%' } (DbType = Object) +@collection={ 'a%' +'b%' +'c%' } (DbType = Object) SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."Phone", c."PostalCode", c."Region" FROM "Customers" AS c diff --git a/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs index ced876e7cb..93555b7b9f 100644 --- a/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs @@ -1793,7 +1793,9 @@ public override async Task Contains_with_parameterized_collection() AssertSql( """ -@ids={ '1', '2', '3' } (DbType = Object) +@ids={ '1' +'2' +'3' } (DbType = Object) SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b diff --git a/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs index c767280294..eee29515c9 100644 --- a/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs @@ -420,7 +420,9 @@ public override async Task Inline_collection_Contains_with_EF_Parameter() AssertSql( """ -@p={ '2', '999', '1000' } (DbType = Object) +@p={ '2' +'999' +'1000' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -434,7 +436,9 @@ public override async Task Inline_collection_Count_with_column_predicate_with_EF AssertSql( """ -@p={ '2', '999', '1000' } (DbType = Object) +@p={ '2' +'999' +'1000' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -451,7 +455,8 @@ public override async Task Parameter_collection_Count() AssertSql( """ -@ids={ '2', '999' } (DbType = Object) +@ids={ '2' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -468,7 +473,8 @@ public override async Task Parameter_collection_of_ints_Contains_int() AssertSql( """ -@ints={ '10', '999' } (DbType = Object) +@ints={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -476,7 +482,8 @@ public override async Task Parameter_collection_of_ints_Contains_int() """, // """ -@ints={ '10', '999' } (DbType = Object) +@ints={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -490,7 +497,8 @@ public override async Task Parameter_collection_HashSet_of_ints_Contains_int() AssertSql( """ -@ints={ '10', '999' } (DbType = Object) +@ints={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -498,7 +506,8 @@ public override async Task Parameter_collection_HashSet_of_ints_Contains_int() """, // """ -@ints={ '10', '999' } (DbType = Object) +@ints={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -515,7 +524,8 @@ public virtual async Task Parameter_collection_HashSet_with_value_converter_Cont AssertSql( """ -@enums={ '0', '3' } (DbType = Object) +@enums={ '0' +'3' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -529,7 +539,8 @@ public override async Task Parameter_collection_ImmutableArray_of_ints_Contains_ AssertSql( """ -@ints={ '10', '999' } (Nullable = false) (DbType = Object) +@ints={ '10' +'999' } (Nullable = false) (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -537,7 +548,8 @@ public override async Task Parameter_collection_ImmutableArray_of_ints_Contains_ """, // """ -@ints={ '10', '999' } (Nullable = false) (DbType = Object) +@ints={ '10' +'999' } (Nullable = false) (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -551,7 +563,8 @@ public override async Task Parameter_collection_of_ints_Contains_nullable_int() AssertSql( """ -@ints={ '10', '999' } (DbType = Object) +@ints={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -559,7 +572,8 @@ public override async Task Parameter_collection_of_ints_Contains_nullable_int() """, // """ -@ints={ '10', '999' } (DbType = Object) +@ints={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -573,7 +587,8 @@ public override async Task Parameter_collection_of_nullable_ints_Contains_int() AssertSql( """ -@nullableInts={ '10', '999' } (DbType = Object) +@nullableInts={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -581,7 +596,8 @@ public override async Task Parameter_collection_of_nullable_ints_Contains_int() """, // """ -@nullableInts={ '10', '999' } (DbType = Object) +@nullableInts={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -595,7 +611,8 @@ public override async Task Parameter_collection_of_nullable_ints_Contains_nullab AssertSql( """ -@nullableInts={ NULL, '999' } (DbType = Object) +@nullableInts={ NULL +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -603,7 +620,8 @@ public override async Task Parameter_collection_of_nullable_ints_Contains_nullab """, // """ -@nullableInts={ NULL, '999' } (DbType = Object) +@nullableInts={ NULL +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -617,7 +635,8 @@ public override async Task Parameter_collection_of_structs_Contains_struct() AssertSql( """ -@values={ '22', '33' } (DbType = Object) +@values={ '22' +'33' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -625,7 +644,8 @@ public override async Task Parameter_collection_of_structs_Contains_struct() """, // """ -@values={ '11', '44' } (DbType = Object) +@values={ '11' +'44' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -639,7 +659,8 @@ public override async Task Parameter_collection_of_strings_Contains_string() AssertSql( """ -@strings={ '10', '999' } (DbType = Object) +@strings={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -647,7 +668,8 @@ public override async Task Parameter_collection_of_strings_Contains_string() """, // """ -@strings={ '10', '999' } (DbType = Object) +@strings={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -661,7 +683,8 @@ public override async Task Parameter_collection_of_strings_Contains_nullable_str AssertSql( """ -@strings={ '10', '999' } (DbType = Object) +@strings={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -669,7 +692,8 @@ public override async Task Parameter_collection_of_strings_Contains_nullable_str """, // """ -@strings={ '10', '999' } (DbType = Object) +@strings={ '10' +'999' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -683,7 +707,8 @@ public override async Task Parameter_collection_of_nullable_strings_Contains_str AssertSql( """ -@strings={ '10', NULL } (DbType = Object) +@strings={ '10' +NULL } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -691,7 +716,8 @@ public override async Task Parameter_collection_of_nullable_strings_Contains_str """, // """ -@strings={ '10', NULL } (DbType = Object) +@strings={ '10' +NULL } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -705,7 +731,8 @@ public override async Task Parameter_collection_of_nullable_strings_Contains_nul AssertSql( """ -@strings={ '999', NULL } (DbType = Object) +@strings={ '999' +NULL } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -713,7 +740,8 @@ public override async Task Parameter_collection_of_nullable_strings_Contains_nul """, // """ -@strings={ '999', NULL } (DbType = Object) +@strings={ '999' +NULL } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -727,7 +755,8 @@ public override async Task Parameter_collection_of_DateTimes_Contains() AssertSql( """ -@dateTimes={ '2020-01-10T12:30:00.0000000Z', '9999-01-01T00:00:00.0000000Z' } (DbType = Object) +@dateTimes={ '2020-01-10T12:30:00.0000000Z' +'9999-01-01T00:00:00.0000000Z' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -755,7 +784,8 @@ public override async Task Parameter_collection_of_enums_Contains() AssertSql( """ -@enums={ '0', '3' } (DbType = Object) +@enums={ '0' +'3' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -851,7 +881,8 @@ await AssertQuery( AssertSql( """ -@ranges={ '[5,15]', '[40,50]' } (DbType = Object) +@ranges={ '[5,15]' +'[40,50]' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1127,7 +1158,9 @@ public override async Task Parameter_collection_index_Column_equal_Column() AssertSql( """ -@ints={ '0', '2', '3' } (DbType = Object) +@ints={ '0' +'2' +'3' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1141,7 +1174,9 @@ public override async Task Parameter_collection_index_Column_equal_constant() AssertSql( """ -@ints={ '1', '2', '3' } (DbType = Object) +@ints={ '1' +'2' +'3' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1449,7 +1484,8 @@ public override async Task Column_collection_Join_parameter_collection() AssertSql( """ -@ints={ '11', '111' } (DbType = Object) +@ints={ '11' +'111' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1481,7 +1517,8 @@ public override async Task Parameter_collection_Concat_column_collection() AssertSql( """ -@ints={ '11', '111' } (DbType = Object) +@ints={ '11' +'111' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1495,7 +1532,8 @@ public override async Task Parameter_collection_with_type_inference_for_JsonScal AssertSql( """ -@values={ 'one', 'two' } (DbType = Object) +@values={ 'one' +'two' } (DbType = Object) SELECT CASE WHEN p."Id" <> 0 THEN @values[p."Int" % 2 + 1] @@ -1511,7 +1549,8 @@ public override async Task Column_collection_Union_parameter_collection() AssertSql( """ -@ints={ '11', '111' } (DbType = Object) +@ints={ '11' +'111' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1555,7 +1594,8 @@ public virtual async Task Column_collection_Intersect_Parameter_collection_Any() AssertSql( """ -@ints={ '11', '12' } (DbType = Object) +@ints={ '11' +'12' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1637,7 +1677,8 @@ public override async Task Column_collection_equality_parameter_collection() AssertSql( """ -@ints={ '1', '10' } (DbType = Object) +@ints={ '1' +'10' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1689,7 +1730,8 @@ public override async Task Parameter_collection_in_subquery_Union_column_collect AssertSql( """ -@ints={ '10', '111' } (DbType = Object) +@ints={ '10' +'111' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -1782,7 +1824,8 @@ public override async Task Parameter_collection_in_subquery_Count_as_compiled_qu AssertSql( """ -@ints={ '10', '111' } (DbType = Object) +@ints={ '10' +'111' } (DbType = Object) SELECT count(*)::int FROM "PrimitiveCollectionsEntity" AS p @@ -1799,7 +1842,8 @@ public override async Task Column_collection_in_subquery_Union_parameter_collect AssertSql( """ -@ints={ '10', '111' } (DbType = Object) +@ints={ '10' +'111' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -2061,8 +2105,12 @@ public override async Task Nested_contains_with_Lists_and_no_inferred_type_mappi AssertSql( """ -@ints={ '1', '2', '3' } (DbType = Object) -@strings={ 'one', 'two', 'three' } (DbType = Object) +@ints={ '1' +'2' +'3' } (DbType = Object) +@strings={ 'one' +'two' +'three' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -2079,8 +2127,12 @@ public override async Task Nested_contains_with_arrays_and_no_inferred_type_mapp AssertSql( """ -@ints={ '1', '2', '3' } (DbType = Object) -@strings={ 'one', 'two', 'three' } (DbType = Object) +@ints={ '1' +'2' +'3' } (DbType = Object) +@strings={ 'one' +'two' +'three' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -2127,7 +2179,8 @@ public override async Task Parameter_collection_of_structs_Contains_nullable_str AssertSql( """ -@values={ '22', '33' } (DbType = Object) +@values={ '22' +'33' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -2135,7 +2188,8 @@ public override async Task Parameter_collection_of_structs_Contains_nullable_str """, // """ -@values={ '11', '44' } (DbType = Object) +@values={ '11' +'44' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -2153,7 +2207,8 @@ public override async Task Parameter_collection_of_nullable_structs_Contains_str AssertSql( """ -@values={ NULL, '22' } (DbType = Object) +@values={ NULL +'22' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -2161,7 +2216,8 @@ public override async Task Parameter_collection_of_nullable_structs_Contains_str """, // """ -@values={ '11', '44' } (DbType = Object) +@values={ '11' +'44' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -2175,7 +2231,8 @@ public override async Task Parameter_collection_of_nullable_structs_Contains_nul AssertSql( """ -@values={ NULL, '22' } (DbType = Object) +@values={ NULL +'22' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p @@ -2183,7 +2240,8 @@ public override async Task Parameter_collection_of_nullable_structs_Contains_nul """, // """ -@values={ '11', '44' } (DbType = Object) +@values={ '11' +'44' } (DbType = Object) SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId" FROM "PrimitiveCollectionsEntity" AS p diff --git a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonStructuralEqualityNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonStructuralEqualityNpgsqlTest.cs deleted file mode 100644 index 86a5020169..0000000000 --- a/test/EFCore.PG.FunctionalTests/Query/Relationships/ComplexJson/ComplexJsonStructuralEqualityNpgsqlTest.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace Microsoft.EntityFrameworkCore.Query.Relationships.ComplexJson; - -public class ComplexJsonStructuralEqualityNpgsqlTest(ComplexJsonNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) - : ComplexJsonStructuralEqualityRelationalTestBase(fixture, testOutputHelper) -{ - // The SQL Server json type cannot be compared ("The JSON data type cannot be compared or sorted, except when using the - // IS NULL operator"). - // So we find comparisons that involve the json type, and apply a conversion to string (nvarchar(max)) to both sides. - - public override async Task Two_related() - { - await base.Two_related(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated") = (r."OptionalRelated") -"""); - } - - public override async Task Two_nested() - { - await base.Two_nested(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated" -> 'RequiredNested') = (r."OptionalRelated" -> 'RequiredNested') -"""); - } - - public override async Task Not_equals() - { - await base.Not_equals(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated") <> (r."OptionalRelated") OR (r."OptionalRelated") IS NULL -"""); - } - - public override async Task Related_with_inline_null() - { - await base.Related_with_inline_null(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."OptionalRelated") IS NULL -"""); - } - - public override async Task Related_with_parameter_null() - { - await base.Related_with_parameter_null(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."OptionalRelated") IS NULL -"""); - } - - public override async Task Nested_with_inline_null() - { - await base.Nested_with_inline_null(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated" ->> 'OptionalNested') IS NULL -"""); - } - - public override async Task Nested_with_inline() - { - await base.Nested_with_inline(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated" -> 'RequiredNested') = '{"Id":1000,"Int":8,"Name":"Root1_RequiredRelated_RequiredNested","String":"foo"}' -"""); - } - - public override async Task Nested_with_parameter() - { - await base.Nested_with_parameter(); - - AssertSql( - """ -@entity_equality_nested='?' (DbType = Object) - -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated" -> 'RequiredNested') = @entity_equality_nested -"""); - } - - public override async Task Two_nested_collections() - { - await base.Two_nested_collections(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated" -> 'NestedCollection') = (r."OptionalRelated" -> 'NestedCollection') -"""); - } - - public override async Task Nested_collection_with_inline() - { - await base.Nested_collection_with_inline(); - - AssertSql( - """ -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated" -> 'NestedCollection') = '[{"Id":1002,"Int":8,"Name":"Root1_RequiredRelated_NestedCollection_1","String":"foo"},{"Id":1003,"Int":8,"Name":"Root1_RequiredRelated_NestedCollection_2","String":"foo"}]' -"""); - } - - public override async Task Nested_collection_with_parameter() - { - await base.Nested_collection_with_parameter(); - - AssertSql( - """ -@entity_equality_nestedCollection='?' (DbType = Object) - -SELECT r."Id", r."Name", r."OptionalRelated", r."RelatedCollection", r."RequiredRelated" -FROM "RootEntity" AS r -WHERE (r."RequiredRelated" -> 'NestedCollection') = @entity_equality_nestedCollection -"""); - } - - [ConditionalFact] - public virtual void Check_all_tests_overridden() - => TestHelpers.AssertAllMethodsOverridden(GetType()); -} diff --git a/test/EFCore.PG.FunctionalTests/Query/Translations/LTreeTranslationsTest.cs b/test/EFCore.PG.FunctionalTests/Query/Translations/LTreeTranslationsTest.cs index 15060a5b55..34c5b4141b 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Translations/LTreeTranslationsTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Translations/LTreeTranslationsTest.cs @@ -176,7 +176,8 @@ public void LTree_matches_any_LQuery() AssertSql( """ -@lqueries={ '*.Astrophysics', '*.Geology' } (DbType = Object) +@lqueries={ '*.Astrophysics' +'*.Geology' } (DbType = Object) SELECT l."Id", l."LTree", l."LTreeAsString", l."LTrees", l."SomeString" FROM "LTreeEntities" AS l @@ -226,7 +227,8 @@ public void LTree_contains_any_LTree() Assert.Equal(4, count); AssertSql( """ -@ltrees={ 'Top.Science', 'Top.Art' } (DbType = Object) +@ltrees={ 'Top.Science' +'Top.Art' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l @@ -244,7 +246,8 @@ public void LTree_contained_by_any_LTree() Assert.Equal(3, count); AssertSql( """ -@ltrees={ 'Top.Science.Astronomy', 'Top.Art' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy' +'Top.Art' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l @@ -262,7 +265,8 @@ public void Any_LTree_matches_LQuery() AssertSql( """ -@ltrees={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy.Astrophysics' +'Top.Science.Astronomy.Cosmology' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l @@ -281,7 +285,8 @@ public void Any_LTree_matches_any_LQuery() AssertSql( """ -@lqueries={ '*.Astrophysics', '*.Geology' } (DbType = Object) +@lqueries={ '*.Astrophysics' +'*.Geology' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l @@ -315,7 +320,8 @@ public void First_LTree_ancestor() Assert.Equal(4, count); AssertSql( """ -@ltrees={ 'Top.Science', 'Top.Hobbies' } (DbType = Object) +@ltrees={ 'Top.Science' +'Top.Hobbies' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l @@ -334,7 +340,8 @@ public void First_LTree_descendant() Assert.Equal(3, count); AssertSql( """ -@ltrees={ 'Top.Science.Astronomy', 'Top.Hobbies.Amateurs_Astronomy' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy' +'Top.Hobbies.Amateurs_Astronomy' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l @@ -353,7 +360,8 @@ public void First_LTree_matches_LQuery() AssertSql( """ -@ltrees={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy.Astrophysics' +'Top.Science.Astronomy.Cosmology' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l @@ -371,7 +379,8 @@ public void First_LTree_matches_LTxtQuery() AssertSql( """ -@ltrees={ 'Top.Science.Astronomy.Astrophysics', 'Top.Science.Astronomy.Cosmology' } (DbType = Object) +@ltrees={ 'Top.Science.Astronomy.Astrophysics' +'Top.Science.Astronomy.Cosmology' } (DbType = Object) SELECT count(*)::int FROM "LTreeEntities" AS l diff --git a/test/EFCore.PG.FunctionalTests/Query/Translations/MultirangeTranslationsTest.cs b/test/EFCore.PG.FunctionalTests/Query/Translations/MultirangeTranslationsTest.cs index e1621c8a95..0527c2b537 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Translations/MultirangeTranslationsTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Translations/MultirangeTranslationsTest.cs @@ -122,7 +122,8 @@ public void Equals_operator() AssertSql( """ -@multirange={ '[0,5]', '[7,10]' } (DbType = Object) +@multirange={ '[0,5]' +'[7,10]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t @@ -145,7 +146,8 @@ public void Equals_method() AssertSql( """ -@multirange={ '[0,5]', '[7,10]' } (DbType = Object) +@multirange={ '[0,5]' +'[7,10]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t @@ -168,7 +170,8 @@ public void Overlaps_multirange() AssertSql( """ -@multirange={ '[-3,0]', '[100,101]' } (DbType = Object) +@multirange={ '[-3,0]' +'[100,101]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t @@ -214,7 +217,8 @@ public void IsStrictlyLeftOf_multirange() AssertSql( """ -@multirange={ '[11,13]', '[15,16]' } (DbType = Object) +@multirange={ '[11,13]' +'[15,16]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t @@ -260,7 +264,8 @@ public void IsStrictlyRightOf_multirange() AssertSql( """ -@multirange={ '[-10,-7]', '[-5,3]' } (DbType = Object) +@multirange={ '[-10,-7]' +'[-5,3]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t @@ -306,7 +311,8 @@ public void DoesNotExtendLeftOf_multirange() AssertSql( """ -@multirange={ '[2,7]', '[13,18]' } (DbType = Object) +@multirange={ '[2,7]' +'[13,18]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t @@ -352,7 +358,8 @@ public void DoesNotExtendRightOf_multirange() AssertSql( """ -@multirange={ '[-5,-3]', '[13,18]' } (DbType = Object) +@multirange={ '[-5,-3]' +'[13,18]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t @@ -398,7 +405,8 @@ public void IsAdjacentTo_multirange() AssertSql( """ -@multirange={ '[-5,-4]', '[-2,-1]' } (DbType = Object) +@multirange={ '[-5,-4]' +'[-2,-1]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t @@ -467,7 +475,8 @@ public void Intersect_multirange() AssertSql( """ -@multirange={ '[-5,1]', '[9,13]' } (DbType = Object) +@multirange={ '[-5,1]' +'[9,13]' } (DbType = Object) SELECT t."Id", t."DateOnlyDateMultirange", t."DateTimeDateMultirange", t."DecimalMultirange", t."IntMultirange", t."LongMultirange" FROM "TestEntities" AS t