Skip to content

Commit fa8fa82

Browse files
MackinnonBuckgithub-actions
authored andcommitted
Fix test
1 parent 40f0bad commit fa8fa82

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Identity/EntityFrameworkCore/test/EF.Test/Utilities/ScratchDatabaseFixture.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Data.Common;
55
using Microsoft.Data.Sqlite;
66
using Microsoft.EntityFrameworkCore;
7+
using Microsoft.Extensions.DependencyInjection;
78

89
namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test;
910

@@ -23,7 +24,14 @@ public ScratchDatabaseFixture()
2324
}
2425

2526
private DbContext CreateEmptyContext()
26-
=> new DbContext(new DbContextOptionsBuilder().UseSqlite(_connection).Options);
27+
{
28+
var services = new ServiceCollection();
29+
services.Configure<IdentityOptions>(options => options.Stores.SchemaVersion = IdentitySchemaVersions.Version3);
30+
return new DbContext(new DbContextOptionsBuilder()
31+
.UseSqlite(_connection)
32+
.UseApplicationServiceProvider(services.BuildServiceProvider())
33+
.Options);
34+
}
2735

2836
public DbConnection Connection => _connection;
2937

0 commit comments

Comments
 (0)