@@ -20,19 +20,15 @@ namespace PowerShellEditorServices.Test.Session
20
20
using System . Management . Automation . Runspaces ;
21
21
22
22
[ Trait ( "Category" , "PsesInternalHost" ) ]
23
- public class PsesInternalHostTests : IDisposable
23
+ public class PsesInternalHostTests : IAsyncLifetime
24
24
{
25
25
private readonly PsesInternalHost psesHost ;
26
26
27
27
public PsesInternalHostTests ( ) => psesHost = PsesHostFactory . Create ( NullLoggerFactory . Instance ) ;
28
28
29
- public void Dispose ( )
30
- {
31
- #pragma warning disable VSTHRD002
32
- psesHost . StopAsync ( ) . Wait ( ) ;
33
- #pragma warning restore VSTHRD002
34
- GC . SuppressFinalize ( this ) ;
35
- }
29
+ public Task InitializeAsync ( ) => Task . CompletedTask ;
30
+
31
+ public async Task DisposeAsync ( ) => await psesHost . StopAsync ( ) ;
36
32
37
33
[ Fact ]
38
34
public async Task CanExecutePSCommand ( )
@@ -238,19 +234,15 @@ public async Task CanHandleBadInitialWorkingDirectory(string path)
238
234
}
239
235
240
236
[ Trait ( "Category" , "PsesInternalHost" ) ]
241
- public class PsesInternalHostWithProfileTests : IDisposable
237
+ public class PsesInternalHostWithProfileTests : IAsyncLifetime
242
238
{
243
239
private readonly PsesInternalHost psesHost ;
244
240
245
241
public PsesInternalHostWithProfileTests ( ) => psesHost = PsesHostFactory . Create ( NullLoggerFactory . Instance , loadProfiles : true ) ;
246
242
247
- public void Dispose ( )
248
- {
249
- #pragma warning disable VSTHRD002
250
- psesHost . StopAsync ( ) . Wait ( ) ;
251
- #pragma warning restore VSTHRD002
252
- GC . SuppressFinalize ( this ) ;
253
- }
243
+ public Task InitializeAsync ( ) => Task . CompletedTask ;
244
+
245
+ public async Task DisposeAsync ( ) => await psesHost . StopAsync ( ) ;
254
246
255
247
[ Fact ]
256
248
public async Task CanResolveAndLoadProfilesForHostId ( )
0 commit comments