@@ -20,19 +20,15 @@ namespace PowerShellEditorServices.Test.Session
2020 using System . Management . Automation . Runspaces ;
2121
2222 [ Trait ( "Category" , "PsesInternalHost" ) ]
23- public class PsesInternalHostTests : IDisposable
23+ public class PsesInternalHostTests : IAsyncLifetime
2424 {
2525 private readonly PsesInternalHost psesHost ;
2626
2727 public PsesInternalHostTests ( ) => psesHost = PsesHostFactory . Create ( NullLoggerFactory . Instance ) ;
2828
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 ( ) ;
3632
3733 [ Fact ]
3834 public async Task CanExecutePSCommand ( )
@@ -238,19 +234,15 @@ public async Task CanHandleBadInitialWorkingDirectory(string path)
238234 }
239235
240236 [ Trait ( "Category" , "PsesInternalHost" ) ]
241- public class PsesInternalHostWithProfileTests : IDisposable
237+ public class PsesInternalHostWithProfileTests : IAsyncLifetime
242238 {
243239 private readonly PsesInternalHost psesHost ;
244240
245241 public PsesInternalHostWithProfileTests ( ) => psesHost = PsesHostFactory . Create ( NullLoggerFactory . Instance , loadProfiles : true ) ;
246242
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 ( ) ;
254246
255247 [ Fact ]
256248 public async Task CanResolveAndLoadProfilesForHostId ( )
0 commit comments