-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
AspNetIdentityCustomTypesDefaultInMemoryTest.cs
46 lines (38 loc) · 1.93 KB
/
AspNetIdentityCustomTypesDefaultInMemoryTest.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
38
39
40
41
42
43
44
45
46
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.EntityFrameworkCore;
public class AspNetIdentityCustomTypesDefaultInMemoryTest
: AspNetIdentityCustomTypesDefaultTestBase<
AspNetIdentityCustomTypesDefaultInMemoryTest.AspNetIdentityCustomTypesDefaultInMemoryFixture>
{
public AspNetIdentityCustomTypesDefaultInMemoryTest(AspNetIdentityCustomTypesDefaultInMemoryFixture fixture)
: base(fixture)
{
}
protected override void UseTransaction(DatabaseFacade facade, IDbContextTransaction transaction)
{
}
protected override async Task ExecuteWithStrategyInTransactionAsync(
Func<CustomTypesIdentityContext, Task> testOperation,
Func<CustomTypesIdentityContext, Task> nestedTestOperation1 = null,
Func<CustomTypesIdentityContext, Task> nestedTestOperation2 = null,
Func<CustomTypesIdentityContext, Task> nestedTestOperation3 = null)
{
await base.ExecuteWithStrategyInTransactionAsync(
testOperation, nestedTestOperation1, nestedTestOperation2, nestedTestOperation3);
await Fixture.ReseedAsync();
}
public class AspNetIdentityCustomTypesDefaultInMemoryFixture : AspNetIdentityFixtureBase
{
protected override IServiceCollection AddServices(IServiceCollection serviceCollection)
=> base.AddServices(serviceCollection).AddEntityFrameworkProxies();
public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder)
=> base.AddOptions(builder)
.UseLazyLoadingProxies()
.ConfigureWarnings(e => e.Ignore(InMemoryEventId.TransactionIgnoredWarning));
protected override ITestStoreFactory TestStoreFactory
=> InMemoryTestStoreFactory.Instance;
protected override string StoreName
=> "AspNetCustomTypesDefaultIdentity";
}
}