Skip to content

Commit f3cf23d

Browse files
fix tests
1 parent 62b2548 commit f3cf23d

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/EFCore.Ydb/test/EntityFrameworkCore.Ydb.FunctionalTests/Migrations/YdbMigrationsInfrastructureTest.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Microsoft.EntityFrameworkCore;
33
using Microsoft.EntityFrameworkCore.Migrations;
44
using Microsoft.EntityFrameworkCore.TestUtilities;
5-
using Microsoft.Extensions.DependencyInjection;
65
using Xunit;
76

87
namespace EntityFrameworkCore.Ydb.FunctionalTests.Migrations;
@@ -12,13 +11,8 @@ public class YdbMigrationsInfrastructureTest(YdbMigrationsInfrastructureTest.Ydb
1211
{
1312
public class YdbMigrationsInfrastructureFixture : MigrationsInfrastructureFixtureBase
1413
{
15-
protected override ITestStoreFactory TestStoreFactory => YdbTestStoreFactory.Instance;
16-
17-
protected override IServiceCollection AddServices(IServiceCollection serviceCollection)
18-
{
19-
YdbTestStoreFactory.Instance.UseYdbExecutionStrategy = false;
20-
return base.AddServices(serviceCollection);
21-
}
14+
protected override ITestStoreFactory TestStoreFactory =>
15+
new YdbTestStoreFactory(useYdbExecutionStrategy: false);
2216
}
2317

2418
protected override void GiveMeSomeTime(DbContext db)

src/EFCore.Ydb/test/EntityFrameworkCore.Ydb.FunctionalTests/TestUtilities/YdbTestStoreFactory.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
namespace EntityFrameworkCore.Ydb.FunctionalTests.TestUtilities;
66

7-
public class YdbTestStoreFactory(string? additionalSql = null) : RelationalTestStoreFactory
7+
public class YdbTestStoreFactory(string? additionalSql = null, bool useYdbExecutionStrategy = true)
8+
: RelationalTestStoreFactory
89
{
910
public static YdbTestStoreFactory Instance { get; } = new();
1011

1112
private readonly string? _scriptPath = null;
1213

13-
public bool UseYdbExecutionStrategy { get; set; } = true;
14-
1514
public override TestStore Create(string storeName) =>
1615
new YdbTestStore(storeName, _scriptPath, additionalSql);
1716

1817
public override TestStore GetOrCreate(string storeName)
1918
=> new YdbTestStore(storeName, _scriptPath, additionalSql);
2019

2120
public override IServiceCollection AddProviderServices(IServiceCollection serviceCollection)
22-
=> serviceCollection.AddEntityFrameworkYdb(UseYdbExecutionStrategy);
21+
=> serviceCollection.AddEntityFrameworkYdb(useYdbExecutionStrategy);
2322
}

0 commit comments

Comments
 (0)