Skip to content

Commit 2d9b61e

Browse files
Copilotrenemadsen
andcommitted
Revert EntitySplittingMySqlTest and EFCoreCompatibilityTests to original working state - focus on test override conversions only
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
1 parent eabafaa commit 2d9b61e

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

test/EFCore.MySql.FunctionalTests/EFCoreCompatibilityTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
using System.Linq;
66
using System.Threading.Tasks;
77
using Microsoft.EntityFrameworkCore;
8+
using Pomelo.EntityFrameworkCore.MySql.Infrastructure.Internal;
89
using Xunit;
9-
using CompatHelper = Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure.Internal.EFCoreCompatibilityHelper;
1010

1111
namespace Pomelo.EntityFrameworkCore.MySql.FunctionalTests
1212
{
@@ -27,7 +27,7 @@ public EFCoreCompatibilityTests(CompatibilityTestFixture fixture)
2727
public void EFCoreVersion_IsDetected()
2828
{
2929
// Verify that version detection works
30-
var version = CompatHelper.EFCoreVersion;
30+
var version = EFCoreCompatibilityHelper.EFCoreVersion;
3131
Assert.NotNull(version);
3232
Assert.True(version.Major >= 8, "Should be using EF Core 8 or greater");
3333
}
@@ -36,19 +36,19 @@ public void EFCoreVersion_IsDetected()
3636
public void VersionFlags_AreSetCorrectly()
3737
{
3838
// Test version detection flags
39-
var isEFCore8OrGreater = CompatHelper.IsEFCore8OrGreater;
40-
var isEFCore9OrGreater = CompatHelper.IsEFCore9OrGreater;
41-
var isEFCore10OrGreater = CompatHelper.IsEFCore10OrGreater;
39+
var isEFCore8OrGreater = EFCoreCompatibilityHelper.IsEFCore8OrGreater;
40+
var isEFCore9OrGreater = EFCoreCompatibilityHelper.IsEFCore9OrGreater;
41+
var isEFCore10OrGreater = EFCoreCompatibilityHelper.IsEFCore10OrGreater;
4242

4343
Assert.True(isEFCore8OrGreater, "Should support EF Core 8+");
4444

4545
// These will be true based on the actual EF Core version being used
46-
if (CompatHelper.EFCoreVersion.Major >= 9)
46+
if (EFCoreCompatibilityHelper.EFCoreVersion.Major >= 9)
4747
{
4848
Assert.True(isEFCore9OrGreater);
4949
}
5050

51-
if (CompatHelper.EFCoreVersion.Major >= 10)
51+
if (EFCoreCompatibilityHelper.EFCoreVersion.Major >= 10)
5252
{
5353
Assert.True(isEFCore10OrGreater);
5454
}
@@ -138,19 +138,19 @@ await context.TestEntities
138138
public void CreateExecuteUpdateSetter_ReturnsCorrectType()
139139
{
140140
// Test the compatibility helper method
141-
if (CompatHelper.IsEFCore10OrGreater)
141+
if (EFCoreCompatibilityHelper.IsEFCore10OrGreater)
142142
{
143143
// For EF Core 10+, should return Action<T>
144144
Action<TestEntity> action = e => e.Name = "test";
145-
var result = CompatHelper.CreateExecuteUpdateSetter<TestEntity>(setterAction: action);
145+
var result = EFCoreCompatibilityHelper.CreateExecuteUpdateSetter<TestEntity>(setterAction: action);
146146
Assert.IsType<Action<TestEntity>>(result);
147147
}
148148
else
149149
{
150150
// For EF Core 9-, should return Expression<Func<T, T>>
151151
System.Linq.Expressions.Expression<Func<TestEntity, TestEntity>> expression =
152152
e => new TestEntity { Name = "test" };
153-
var result = CompatHelper.CreateExecuteUpdateSetter<TestEntity>(setterExpression: expression);
153+
var result = EFCoreCompatibilityHelper.CreateExecuteUpdateSetter<TestEntity>(setterExpression: expression);
154154
Assert.IsType<System.Linq.Expressions.Expression<Func<TestEntity, TestEntity>>>(result);
155155
}
156156
}
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
using Microsoft.EntityFrameworkCore;
2-
using Microsoft.EntityFrameworkCore.TestModels.EntitySplittingModel;
32
using Microsoft.EntityFrameworkCore.TestUtilities;
43
using Pomelo.EntityFrameworkCore.MySql.FunctionalTests.TestUtilities;
54
using Xunit.Abstractions;
65

76
namespace Pomelo.EntityFrameworkCore.MySql.FunctionalTests;
87

9-
public class EntitySplittingMySqlTest(EntitySplittingMySqlTest.EntitySplittingMySqlFixture fixture, ITestOutputHelper testOutputHelper)
10-
: EntitySplittingTestBase(fixture, testOutputHelper)
8+
public class EntitySplittingMySqlTest : EntitySplittingTestBase
119
{
12-
protected override ITestStoreFactory TestStoreFactory
13-
=> MySqlTestStoreFactory.Instance;
14-
15-
public class EntitySplittingMySqlFixture : NonSharedModelTestFixture
10+
public EntitySplittingMySqlTest(ITestOutputHelper testOutputHelper)
11+
: base(testOutputHelper)
1612
{
17-
protected override ITestStoreFactory TestStoreFactory
18-
=> MySqlTestStoreFactory.Instance;
19-
20-
protected override string StoreName => "EntitySplittingTest";
2113
}
14+
15+
protected override ITestStoreFactory TestStoreFactory
16+
=> MySqlTestStoreFactory.Instance;
2217
}

0 commit comments

Comments
 (0)