Skip to content

Commit

Permalink
More tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cincuranet committed Dec 16, 2024
1 parent bd83c88 commit 32b128d
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* All Rights Reserved.
*/

//$Authors = Jiri Cincura ([email protected])

using System;
using System.Collections.Generic;
using System.Reflection;

namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests;

public class FbComplianceTest : Microsoft.EntityFrameworkCore.RelationalComplianceTestBase
{
protected override ICollection<Type> IgnoredTestBases { get; } =
[
typeof(Microsoft.EntityFrameworkCore.ApiConsistencyTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BadDataJsonDeserializationTestBase),
typeof(Microsoft.EntityFrameworkCore.BuiltInDataTypesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ComplexTypesTrackingTestBase<>),
typeof(Microsoft.EntityFrameworkCore.CompositeKeyEndToEndTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ConcurrencyDetectorDisabledTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ConcurrencyDetectorEnabledTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ConcurrencyDetectorTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ConferencePlannerTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ConvertToProviderTypesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.CustomConvertersTestBase<>),
typeof(Microsoft.EntityFrameworkCore.DataAnnotationTestBase<>),
typeof(Microsoft.EntityFrameworkCore.DataBindingTestBase<>),
typeof(Microsoft.EntityFrameworkCore.EntityFrameworkServiceCollectionExtensionsTestBase),
typeof(Microsoft.EntityFrameworkCore.FieldMappingTestBase<>),
typeof(Microsoft.EntityFrameworkCore.FieldsOnlyLoadTestBase<>),
typeof(Microsoft.EntityFrameworkCore.FindTestBase<>),
typeof(Microsoft.EntityFrameworkCore.GraphUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ProxyGraphUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.InterceptionTestBase),
typeof(Microsoft.EntityFrameworkCore.JsonTypesTestBase),
typeof(Microsoft.EntityFrameworkCore.KeysWithConvertersTestBase<>),
typeof(Microsoft.EntityFrameworkCore.LazyLoadProxyTestBase<>),
typeof(Microsoft.EntityFrameworkCore.LoadTestBase<>),
typeof(Microsoft.EntityFrameworkCore.LoggingTestBase),
typeof(Microsoft.EntityFrameworkCore.ManyToManyFieldsLoadTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ManyToManyLoadTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ManyToManyTrackingTestBase<>),
typeof(Microsoft.EntityFrameworkCore.MaterializationInterceptionTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding101TestBase),
typeof(Microsoft.EntityFrameworkCore.MonsterFixupTestBase<>),
typeof(Microsoft.EntityFrameworkCore.MusicStoreTestBase<>),
typeof(Microsoft.EntityFrameworkCore.NotificationEntitiesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.OptimisticConcurrencyTestBase<,>),
typeof(Microsoft.EntityFrameworkCore.OverzealousInitializationTestBase<>),
typeof(Microsoft.EntityFrameworkCore.PropertyValuesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.QueryExpressionInterceptionTestBase),
typeof(Microsoft.EntityFrameworkCore.AdHocManyToManyQueryTestBase),
typeof(Microsoft.EntityFrameworkCore.SaveChangesInterceptionTestBase),
typeof(Microsoft.EntityFrameworkCore.SeedingTestBase),
typeof(Microsoft.EntityFrameworkCore.SerializationTestBase<>),
typeof(Microsoft.EntityFrameworkCore.SingletonInterceptorsTestBase<>),
typeof(Microsoft.EntityFrameworkCore.SpatialTestBase<>),
typeof(Microsoft.EntityFrameworkCore.StoreGeneratedFixupTestBase<>),
typeof(Microsoft.EntityFrameworkCore.StoreGeneratedTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ValueConvertersEndToEndTestBase<>),
typeof(Microsoft.EntityFrameworkCore.WithConstructorsTestBase<>),
typeof(Microsoft.EntityFrameworkCore.CommandInterceptionTestBase),
typeof(Microsoft.EntityFrameworkCore.ConcurrencyDetectorDisabledRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ConcurrencyDetectorEnabledRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ConnectionInterceptionTestBase),
typeof(Microsoft.EntityFrameworkCore.DataAnnotationRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.DesignTimeTestBase<>),
typeof(Microsoft.EntityFrameworkCore.EntitySplittingTestBase),
typeof(Microsoft.EntityFrameworkCore.JsonTypesRelationalTestBase),
typeof(Microsoft.EntityFrameworkCore.LoggingRelationalTestBase<,>),
typeof(Microsoft.EntityFrameworkCore.ManyToManyTrackingRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding101RelationalTestBase),
typeof(Microsoft.EntityFrameworkCore.OptimisticConcurrencyRelationalTestBase<,>),
typeof(Microsoft.EntityFrameworkCore.RelationalServiceCollectionExtensionsTestBase),
typeof(Microsoft.EntityFrameworkCore.StoreGeneratedFixupRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.TableSplittingTestBase),
typeof(Microsoft.EntityFrameworkCore.TPTTableSplittingTestBase),
typeof(Microsoft.EntityFrameworkCore.TransactionInterceptionTestBase),
typeof(Microsoft.EntityFrameworkCore.TransactionTestBase<>),
typeof(Microsoft.EntityFrameworkCore.TwoDatabasesTestBase),

typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.ComplexTypeTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.ModelBuilderTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.InheritanceTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.ManyToManyTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.ManyToOneTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.NonRelationshipTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.OneToManyTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.OneToOneTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.ModelBuilderTest.OwnedTypesTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.RelationalModelBuilderTest.RelationalNonRelationshipTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.RelationalModelBuilderTest.RelationalComplexTypeTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.RelationalModelBuilderTest.RelationalInheritanceTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.RelationalModelBuilderTest.RelationalOneToManyTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.RelationalModelBuilderTest.RelationalManyToOneTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.RelationalModelBuilderTest.RelationalOneToOneTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.RelationalModelBuilderTest.RelationalManyToManyTestBase),
typeof(Microsoft.EntityFrameworkCore.ModelBuilding.RelationalModelBuilderTest.RelationalOwnedTypesTestBase),

typeof(Microsoft.EntityFrameworkCore.BulkUpdates.BulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.ComplexTypeBulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.FiltersInheritanceBulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.InheritanceBulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.NonSharedModelBulkUpdatesTestBase),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.NorthwindBulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.ComplexTypeBulkUpdatesRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.FiltersInheritanceBulkUpdatesRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.InheritanceBulkUpdatesRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.NonSharedModelBulkUpdatesRelationalTestBase),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.NorthwindBulkUpdatesRelationalTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.TPCFiltersInheritanceBulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.TPCInheritanceBulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.TPHInheritanceBulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.TPTFiltersInheritanceBulkUpdatesTestBase<>),
typeof(Microsoft.EntityFrameworkCore.BulkUpdates.TPTInheritanceBulkUpdatesTestBase<>),

typeof(Microsoft.EntityFrameworkCore.Update.JsonUpdateTestBase<>),
typeof(Microsoft.EntityFrameworkCore.Update.NonSharedModelUpdatesTestBase),
typeof(Microsoft.EntityFrameworkCore.Update.StoredProcedureUpdateTestBase),
typeof(Microsoft.EntityFrameworkCore.Update.StoreValueGenerationTestBase<>),
typeof(Microsoft.EntityFrameworkCore.Update.UpdateSqlGeneratorTestBase),

typeof(Microsoft.EntityFrameworkCore.Scaffolding.CompiledModelTestBase),
typeof(Microsoft.EntityFrameworkCore.Scaffolding.CompiledModelRelationalTestBase),

typeof(Microsoft.EntityFrameworkCore.Migrations.MigrationsInfrastructureTestBase<>),
typeof(Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGeneratorTestBase),
];

protected override Assembly TargetAssembly { get; } = typeof(FbComplianceTest).Assembly;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* All Rights Reserved.
*/

//$Authors = Jiri Cincura ([email protected])

using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.TestUtilities;

namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query;

public class AdHocAdvancedMappingsQueryFbTest : AdHocAdvancedMappingsQueryRelationalTestBase
{
protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* All Rights Reserved.
*/

//$Authors = Jiri Cincura ([email protected])

using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.TestUtilities;

namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query;

public class AdHocComplexTypeQueryFbTest : AdHocComplexTypeQueryTestBase
{
protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* All Rights Reserved.
*/

//$Authors = Jiri Cincura ([email protected])

using System.Linq;
using System.Threading.Tasks;
using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers;
using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;

namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query;

public class AdHocNavigationsQueryFbTest : AdHocNavigationsQueryRelationalTestBase
{
protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance;

[NotSupportedOnFirebirdFact]
public override Task Let_multiple_references_with_reference_to_outer()
{
return base.Let_multiple_references_with_reference_to_outer();
}

[NotSupportedOnFirebirdFact]
public override Task Projection_with_multiple_includes_and_subquery_with_set_operation()
{
return base.Projection_with_multiple_includes_and_subquery_with_set_operation();
}

[NotSupportedOnFirebirdFact]
public override Task SelectMany_and_collection_in_projection_in_FirstOrDefault()
{
return base.SelectMany_and_collection_in_projection_in_FirstOrDefault();
}

[NotSupportedOnFirebirdFact]
public override Task Correlated_collection_correctly_associates_entities_with_byte_array_keys()
{
return base.Correlated_collection_correctly_associates_entities_with_byte_array_keys();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* All Rights Reserved.
*/

//$Authors = Jiri Cincura ([email protected])

using System.Threading.Tasks;
using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;

namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Query;

public class AdHocQueryFiltersQueryFbTest : AdHocQueryFiltersQueryRelationalTestBase
{
protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance;

[Fact(Skip = "PK name collision and not easy way to override model.")]
public override Task Self_reference_in_query_filter_works()
{
return base.Self_reference_in_query_filter_works();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public override Task Average_Grouped_from_LINQ_101(bool async)
return base.Average_Grouped_from_LINQ_101(async);
}

public class Ef6GroupByFbFixture : Ef6GroupByFixtureBase
public class Ef6GroupByFbFixture : Ef6GroupByFixtureBase, ITestSqlLoggerFactory
{
protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance;

public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory;

protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context)
{
base.OnModelCreating(modelBuilder, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

//$Authors = Jiri Cincura ([email protected])

using System.Linq;
using System.Threading.Tasks;
using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers;
using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities;
Expand All @@ -39,10 +38,12 @@ public override Task String_contains_on_argument_with_wildcard_column(bool async
return base.String_contains_on_argument_with_wildcard_column(async);
}

public class FunkyDataQueryFbFixture : FunkyDataQueryFixtureBase
public class FunkyDataQueryFbFixture : FunkyDataQueryFixtureBase, ITestSqlLoggerFactory
{
protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance;

public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory;

protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context)
{
base.OnModelCreating(modelBuilder, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,10 @@ PrimitiveCollectionsContext CreateContext()
return Fixture.CreateContext();
}

public class PrimitiveCollectionsQueryFbFixture : PrimitiveCollectionsQueryFixtureBase
public class PrimitiveCollectionsQueryFbFixture : PrimitiveCollectionsQueryFixtureBase, ITestSqlLoggerFactory
{
protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance;

public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory;
}
}

0 comments on commit 32b128d

Please sign in to comment.