diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindFunctionsQueryCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindFunctionsQueryCosmosTest.cs index d7e70455d30..60f6ba46599 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindFunctionsQueryCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindFunctionsQueryCosmosTest.cs @@ -1395,6 +1395,12 @@ FROM root c WHERE ((c[""Discriminator""] = ""Customer"") AND STRINGEQUALS(c[""CustomerID""], ""ALFKI""))"); } + [ConditionalTheory(Skip = "Issue #17246")] + public override Task Datetime_subtraction_TotalDays(bool async) + { + return base.Datetime_subtraction_TotalDays(async); + } + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); diff --git a/test/EFCore.Specification.Tests/Query/NorthwindFunctionsQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindFunctionsQueryTestBase.cs index 319710d4572..037c81e9708 100644 --- a/test/EFCore.Specification.Tests/Query/NorthwindFunctionsQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/NorthwindFunctionsQueryTestBase.cs @@ -1893,5 +1893,16 @@ public virtual Task Regex_IsMatch_MethodCall_constant_input(bool async) ss => ss.Set().Where(o => Regex.IsMatch("ALFKI", o.CustomerID)), entryCount: 1); } + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Datetime_subtraction_TotalDays(bool async) + { + var date = new DateTime(1997, 1, 1); + return AssertQuery( + async, + ss => ss.Set().Where(o => o.OrderDate.HasValue && (o.OrderDate.Value - date).TotalDays > 365), + entryCount: 267); + } } } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs index 1b742e7e9a3..680cf207440 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindFunctionsQuerySqlServerTest.cs @@ -1823,6 +1823,11 @@ public override Task Regex_IsMatch_MethodCall_constant_input(bool async) return AssertTranslationFailed(() => base.Regex_IsMatch_MethodCall_constant_input(async)); } + public override Task Datetime_subtraction_TotalDays(bool async) + { + return AssertTranslationFailed(() => base.Datetime_subtraction_TotalDays(async)); + } + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindFunctionsQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindFunctionsQuerySqliteTest.cs index b5ff5b12dcb..c81ec422dd8 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindFunctionsQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/NorthwindFunctionsQuerySqliteTest.cs @@ -617,6 +617,11 @@ public override async Task Regex_IsMatch_MethodCall_constant_input(bool async) WHERE regexp(""c"".""CustomerID"", 'ALFKI')"); } + public override Task Datetime_subtraction_TotalDays(bool async) + { + return AssertTranslationFailed(() => base.Datetime_subtraction_TotalDays(async)); + } + private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); }