File tree Expand file tree Collapse file tree
PrismaDotnetApi/PrismaApi.Test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,15 +5,22 @@ namespace PrismaApi.Test.Configuration;
55
66public class TestClientScope : IDisposable
77{
8- private static readonly AsyncLocal < List < KeyValuePair < string , string > > > CurrentHeaders = new ( ) ;
9- private static readonly AsyncLocal < TestPersonProfile > CurrentUser = new ( ) ;
8+ private static readonly AsyncLocal < List < KeyValuePair < string , string > > ? > CurrentHeaders = new ( ) ;
9+ private static readonly AsyncLocal < TestPersonProfile ? > CurrentUser = new ( ) ;
1010 private static readonly AsyncLocal < Guid ? > CurrentAppId = new ( ) ;
1111
1212 public TestClientScope ( Guid id ) => CurrentAppId . Value = id ;
1313
1414 public TestClientScope ( TestPersonProfile profile ) => CurrentUser . Value = profile ;
1515
16- public void Dispose ( ) => GC . SuppressFinalize ( this ) ;
16+ public void Dispose ( )
17+ {
18+ CurrentHeaders . Value = null ;
19+ CurrentUser . Value = null ;
20+ CurrentAppId . Value = null ;
21+
22+ GC . SuppressFinalize ( this ) ;
23+ }
1724
1825 public TestClientScope SetSigninAppId ( Guid ? appId )
1926 {
Original file line number Diff line number Diff line change @@ -46,10 +46,8 @@ public async Task DisposeAsync()
4646 {
4747 using var scope = ApiFactory . Services . CreateScope ( ) ;
4848 var db = scope . ServiceProvider . GetRequiredService < AppDbContext > ( ) ;
49- db . Database . EnsureDeleted ( ) ;
50-
49+ await db . Database . EnsureDeletedAsync ( ) ;
5150 GC . SuppressFinalize ( db ) ;
52- await Task . CompletedTask ;
5351 }
5452
5553 public TestClientScope UserScope ( ) => new ( PrismaUser ) ;
You can’t perform that action at this time.
0 commit comments