-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
AspNetIdentityDefaultInMemoryTest.cs
37 lines (30 loc) · 1.59 KB
/
AspNetIdentityDefaultInMemoryTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
namespace Microsoft.EntityFrameworkCore;
public class AspNetIdentityDefaultInMemoryTest(AspNetIdentityDefaultInMemoryTest.AspNetDefaultIdentityInMemoryFixture fixture)
: AspNetIdentityDefaultTestBase<AspNetIdentityDefaultInMemoryTest.AspNetDefaultIdentityInMemoryFixture>(fixture)
{
protected override void UseTransaction(DatabaseFacade facade, IDbContextTransaction transaction)
{
}
protected override async Task ExecuteWithStrategyInTransactionAsync(
Func<IdentityDbContext, Task> testOperation,
Func<IdentityDbContext, Task> nestedTestOperation1 = null,
Func<IdentityDbContext, Task> nestedTestOperation2 = null,
Func<IdentityDbContext, Task> nestedTestOperation3 = null)
{
await base.ExecuteWithStrategyInTransactionAsync(
testOperation, nestedTestOperation1, nestedTestOperation2, nestedTestOperation3);
await Fixture.ReseedAsync();
}
public class AspNetDefaultIdentityInMemoryFixture : AspNetIdentityFixtureBase
{
public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder)
=> base.AddOptions(builder).ConfigureWarnings(e => e.Ignore(InMemoryEventId.TransactionIgnoredWarning));
protected override ITestStoreFactory TestStoreFactory
=> InMemoryTestStoreFactory.Instance;
protected override string StoreName
=> "AspNetDefaultIdentity";
}
}