-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
PersistedGrantDbContextInMemoryTest.cs
42 lines (34 loc) · 1.67 KB
/
PersistedGrantDbContextInMemoryTest.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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using IdentityServer4.EntityFramework.DbContexts;
namespace Microsoft.EntityFrameworkCore;
public class PersistedGrantDbContextInMemoryTest
: PersistedGrantDbContextTestBase<PersistedGrantDbContextInMemoryTest.PersistedGrantDbContextInMemoryFixture>
{
public PersistedGrantDbContextInMemoryTest(PersistedGrantDbContextInMemoryFixture fixture)
: base(fixture)
{
}
protected override void UseTransaction(DatabaseFacade facade, IDbContextTransaction transaction)
{
}
protected override async Task ExecuteWithStrategyInTransactionAsync(
Func<PersistedGrantDbContext, Task> testOperation,
Func<PersistedGrantDbContext, Task> nestedTestOperation1 = null,
Func<PersistedGrantDbContext, Task> nestedTestOperation2 = null,
Func<PersistedGrantDbContext, Task> nestedTestOperation3 = null)
{
await base.ExecuteWithStrategyInTransactionAsync(
testOperation, nestedTestOperation1, nestedTestOperation2, nestedTestOperation3);
await Fixture.ReseedAsync();
}
public class PersistedGrantDbContextInMemoryFixture : PersistedGrantDbContextFixtureBase
{
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
=> "PersistedGrantDbContext";
}
}