Skip to content

Commit

Permalink
Test without MySqlModelBuilderGenericTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauxjpn committed Dec 9, 2024
1 parent 4f197dd commit db8d2ff
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public override async Task Can_generate_idempotent_up_and_down_scripts()
{
var exception = await Assert.ThrowsAsync<MySqlException>(() => base.Can_generate_idempotent_up_and_down_scripts());

Assert.Equal("'DELIMITER' should not be used with MySqlConnector. See https://mysqlconnector.net/delimiter", exception.Message);
Assert.StartsWith("'DELIMITER' should not be used with MySqlConnector.", exception.Message);
Assert.Equal(
"""
CREATE TABLE IF NOT EXISTS `__EFMigrationsHistory` (
Expand Down Expand Up @@ -384,7 +384,7 @@ public override async Task Can_generate_idempotent_up_and_down_scripts_noTransac
{
var exception = await Assert.ThrowsAsync<MySqlException>(() => base.Can_generate_idempotent_up_and_down_scripts_noTransactions());

Assert.Equal("'DELIMITER' should not be used with MySqlConnector. See https://mysqlconnector.net/delimiter", exception.Message);
Assert.StartsWith("'DELIMITER' should not be used with MySqlConnector.", exception.Message);
Assert.Equal(
"""
CREATE TABLE IF NOT EXISTS `__EFMigrationsHistory` (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,58 @@

namespace Pomelo.EntityFrameworkCore.MySql.FunctionalTests.ModelBuilding;

public class MySqlModelBuilderGenericTest : MySqlModelBuilderTestBase
internal class MySqlModelBuilderGenericTest : MySqlModelBuilderTestBase
{
public class MySqlGenericNonRelationship(MySqlModelBuilderFixture fixture) : MySqlNonRelationship(fixture)
internal class MySqlGenericNonRelationship(MySqlModelBuilderFixture fixture) : MySqlNonRelationship(fixture)
{
protected override TestModelBuilder CreateModelBuilder(
Action<ModelConfigurationBuilder> configure)
=> new ModelBuilderTest.GenericTestModelBuilder(Fixture, configure);
}

public class MySqlGenericComplexType(MySqlModelBuilderFixture fixture) : MySqlComplexType(fixture)
internal class MySqlGenericComplexType(MySqlModelBuilderFixture fixture) : MySqlComplexType(fixture)
{
protected override TestModelBuilder CreateModelBuilder(
Action<ModelConfigurationBuilder> configure)
=> new ModelBuilderTest.GenericTestModelBuilder(Fixture, configure);
}

public class MySqlGenericInheritance(MySqlModelBuilderFixture fixture) : MySqlInheritance(fixture)
internal class MySqlGenericInheritance(MySqlModelBuilderFixture fixture) : MySqlInheritance(fixture)
{
protected override TestModelBuilder CreateModelBuilder(
Action<ModelConfigurationBuilder> configure)
=> new ModelBuilderTest.GenericTestModelBuilder(Fixture, configure);
}

public class MySqlGenericOneToMany(MySqlModelBuilderFixture fixture) : MySqlOneToMany(fixture)
internal class MySqlGenericOneToMany(MySqlModelBuilderFixture fixture) : MySqlOneToMany(fixture)
{
protected override TestModelBuilder CreateModelBuilder(
Action<ModelConfigurationBuilder> configure)
=> new ModelBuilderTest.GenericTestModelBuilder(Fixture, configure);
}

public class MySqlGenericManyToOne(MySqlModelBuilderFixture fixture) : MySqlManyToOne(fixture)
internal class MySqlGenericManyToOne(MySqlModelBuilderFixture fixture) : MySqlManyToOne(fixture)
{
protected override TestModelBuilder CreateModelBuilder(
Action<ModelConfigurationBuilder> configure)
=> new ModelBuilderTest.GenericTestModelBuilder(Fixture, configure);
}

public class MySqlGenericOneToOne(MySqlModelBuilderFixture fixture) : MySqlOneToOne(fixture)
internal class MySqlGenericOneToOne(MySqlModelBuilderFixture fixture) : MySqlOneToOne(fixture)
{
protected override TestModelBuilder CreateModelBuilder(
Action<ModelConfigurationBuilder> configure)
=> new ModelBuilderTest.GenericTestModelBuilder(Fixture, configure);
}

public class MySqlGenericManyToMany(MySqlModelBuilderFixture fixture) : MySqlManyToMany(fixture)
internal class MySqlGenericManyToMany(MySqlModelBuilderFixture fixture) : MySqlManyToMany(fixture)
{
protected override TestModelBuilder CreateModelBuilder(
Action<ModelConfigurationBuilder> configure)
=> new ModelBuilderTest.GenericTestModelBuilder(Fixture, configure);
}

public class MySqlGenericOwnedTypes(MySqlModelBuilderFixture fixture) : MySqlOwnedTypes(fixture)
internal class MySqlGenericOwnedTypes(MySqlModelBuilderFixture fixture) : MySqlOwnedTypes(fixture)
{
// MySQL stored procedures do not support result columns.
public override void Can_use_sproc_mapping_with_owned_reference()
Expand Down
20 changes: 20 additions & 0 deletions test/EFCore.MySql.FunctionalTests/MySqlComplianceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ModelBuilding;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.Update;

Expand All @@ -12,6 +13,25 @@ public class MySqlComplianceTest : RelationalComplianceTestBase
// TODO: Implement remaining 3.x tests.
protected override ICollection<Type> IgnoredTestBases { get; } = new HashSet<Type>
{
typeof(RelationalModelBuilderTest.RelationalNonRelationshipTestBase),
typeof(RelationalModelBuilderTest.RelationalComplexTypeTestBase),
typeof(RelationalModelBuilderTest.RelationalInheritanceTestBase),
typeof(RelationalModelBuilderTest.RelationalOneToManyTestBase),
typeof(RelationalModelBuilderTest.RelationalManyToOneTestBase),
typeof(RelationalModelBuilderTest.RelationalOneToOneTestBase),
typeof(RelationalModelBuilderTest.RelationalManyToManyTestBase),
typeof(RelationalModelBuilderTest.RelationalOwnedTypesTestBase),

typeof(ModelBuilderTest.ModelBuilderTestBase),
typeof(ModelBuilderTest.NonRelationshipTestBase),
typeof(ModelBuilderTest.ComplexTypeTestBase),
typeof(ModelBuilderTest.InheritanceTestBase),
typeof(ModelBuilderTest.OneToManyTestBase),
typeof(ModelBuilderTest.ManyToOneTestBase),
typeof(ModelBuilderTest.OneToOneTestBase),
typeof(ModelBuilderTest.ManyToManyTestBase),
typeof(ModelBuilderTest.OwnedTypesTestBase),

typeof(UdfDbFunctionTestBase<>),
typeof(TransactionInterceptionTestBase),
typeof(CommandInterceptionTestBase),
Expand Down

0 comments on commit db8d2ff

Please sign in to comment.