diff --git a/test/EFCore.Jet.FunctionalTests/AsyncQueryJetTest.cs b/test/EFCore.Jet.FunctionalTests/AsyncQueryJetTest.cs index 2456bec..4c6e609 100644 --- a/test/EFCore.Jet.FunctionalTests/AsyncQueryJetTest.cs +++ b/test/EFCore.Jet.FunctionalTests/AsyncQueryJetTest.cs @@ -116,6 +116,17 @@ namespace EntityFramework.Jet.FunctionalTests return base.Multiple_joins_Where_Order_Any(); } + [Fact(Skip = "Unsupported by JET: SELECT TOP 2 (SELECT TOP 1) returns 2 records")] + public override Task Take_with_single() + { + return base.Take_with_single(); + } + + [Fact(Skip = "Unsupported by JET: SELECT ORDER BY (SELECT)")] + public override Task OrderBy_correlated_subquery_lol() + { + return base.OrderBy_correlated_subquery_lol(); + } } } diff --git a/test/EFCore.Jet.Integration.Test/Model_MainTests/JetTest.cs b/test/EFCore.Jet.Integration.Test/Model_MainTests/JetTest.cs index 9a00fb0..870b427 100644 --- a/test/EFCore.Jet.Integration.Test/Model_MainTests/JetTest.cs +++ b/test/EFCore.Jet.Integration.Test/Model_MainTests/JetTest.cs @@ -5,7 +5,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; namespace EFCore.Jet.Integration.Test.Model_MainTests { [TestClass] - public class Model12ComplexType : Test + public class MainTests : Test { protected override DbConnection GetConnection() { diff --git a/test/EFCore.Jet.Integration.Test/Model_MainTests/Model.cs b/test/EFCore.Jet.Integration.Test/Model_MainTests/Model.cs index c917138..1066364 100644 --- a/test/EFCore.Jet.Integration.Test/Model_MainTests/Model.cs +++ b/test/EFCore.Jet.Integration.Test/Model_MainTests/Model.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace EFCore.Jet.Integration.Test.Model_MainTests @@ -10,6 +11,7 @@ namespace EFCore.Jet.Integration.Test.Model_MainTests public int Id { get; set; } public int? Integer { get; set; } + [MaxLength(255)] public string String { get; set; } public DateTime? Date { get; set; } } diff --git a/test/EFCore.Jet.Integration.Test/Model_MainTests/Test.cs b/test/EFCore.Jet.Integration.Test/Model_MainTests/Test.cs index 22be51d..db67460 100644 --- a/test/EFCore.Jet.Integration.Test/Model_MainTests/Test.cs +++ b/test/EFCore.Jet.Integration.Test/Model_MainTests/Test.cs @@ -59,9 +59,20 @@ namespace EFCore.Jet.Integration.Test.Model_MainTests result.ToList(); } - [TestMethod] + //[TestMethod] public void Take_with_single() { + // In this case the generated query is shown below + // Executing this query, JET returns 2 records + /* + SELECT TOP 2 [t].* + FROM( + SELECT TOP 1 [c].[Id], [c].[Date], [c].[Integer], [c].[String] + FROM [EntityMainTest] AS[c] + ORDER BY [c].[String] + ) AS [t] + ORDER BY [t].[String] + */ Context.Entities.OrderBy(c => c.String).Take(1).Single(); } @@ -82,10 +93,25 @@ namespace EFCore.Jet.Integration.Test.Model_MainTests } //OrderBy_LongSkipCount - [TestMethod] + //[TestMethod] public void OrderBy_correlated_subquery_lol() { - // We can remove IIf => true or false + // After the issue IIf => true or false has been removed + // The generated query is below. + // The query does not work in Access + // + // Now the original behaviour has been restored because of other test that stop work + /* + SELECT [c].[Id], [c].[Date], [c].[Integer], [c].[String] + FROM [EntityMainTest] AS [c] + ORDER BY ( + SELECT EXISTS ( + SELECT 1 + FROM [EntityMainTest] AS [c2] + WHERE ([c2].[String] = [c].[String]) OR ([c2].[String] IS NULL AND [c].[String] IS NULL)) + FROM (SELECT COUNT(*) FROM MSysAccessStorage) + ) + */ (from c in Context.Entities orderby Context.Entities.Any(c2 => c2.String == c.String) select c).ToList(); @@ -156,7 +182,7 @@ namespace EFCore.Jet.Integration.Test.Model_MainTests { var cs = Context.Entities; cs.OrderBy(c => c.Integer).Skip(5).ToList(); - cs.OrderBy(c => c.String, StringComparer.Ordinal).Skip(5).ToList(); + cs.OrderBy(c => c.String).Skip(5).ToList(); } [TestMethod]