Skip to content

Commit bdb2262

Browse files
committed
Update VersionThreeSchemaTest
1 parent 7987e4b commit bdb2262

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/Identity/EntityFrameworkCore/test/EF.Test/VersionTestDbContext.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ public VersionTwoDbContext(DbContextOptions options)
2424
}
2525
}
2626

27+
public class VersionThreeDbContext : IdentityDbContext<IdentityUser, IdentityRole, string>
28+
{
29+
public VersionThreeDbContext(DbContextOptions options)
30+
: base(options)
31+
{
32+
}
33+
}
34+
2735
public class EmptyDbContext : IdentityDbContext<IdentityUser, IdentityRole, string>
2836
{
2937
public EmptyDbContext(DbContextOptions options)

src/Identity/EntityFrameworkCore/test/EF.Test/VersionThreeSchemaTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,29 @@ public VersionThreeSchemaTest(ScratchDatabaseFixture fixture)
2020

2121
services
2222
.AddSingleton<IConfiguration>(new ConfigurationBuilder().Build())
23-
.AddDbContext<VersionTwoDbContext>(o =>
23+
.AddDbContext<VersionThreeDbContext>(o =>
2424
o.UseSqlite(fixture.Connection)
2525
.ConfigureWarnings(b => b.Log(CoreEventId.ManyServiceProvidersCreatedWarning)))
2626
.AddIdentity<IdentityUser, IdentityRole>(o =>
2727
{
2828
// MaxKeyLength does not need to be set in version 3
2929
o.Stores.SchemaVersion = IdentitySchemaVersions.Version3;
3030
})
31-
.AddEntityFrameworkStores<VersionTwoDbContext>();
31+
.AddEntityFrameworkStores<VersionThreeDbContext>();
3232

3333
services.AddLogging();
3434

3535
_builder = new ApplicationBuilder(services.BuildServiceProvider());
3636
var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
37-
var db = scope.ServiceProvider.GetRequiredService<VersionTwoDbContext>();
37+
var db = scope.ServiceProvider.GetRequiredService<VersionThreeDbContext>();
3838
db.Database.EnsureCreated();
3939
}
4040

4141
[Fact]
4242
public void EnsureDefaultSchema()
4343
{
4444
using var scope = _builder.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
45-
var db = scope.ServiceProvider.GetRequiredService<VersionTwoDbContext>();
45+
var db = scope.ServiceProvider.GetRequiredService<VersionThreeDbContext>();
4646
VerifyVersion3Schema(db);
4747
}
4848

0 commit comments

Comments
 (0)