File tree Expand file tree Collapse file tree
test/PowerShellEditorServices.Test.E2E Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1274,6 +1274,40 @@ await PsesLanguageClient
12741274 Assert . Equal ( "Get-ChildItem" , expandAliasResult . Text ) ;
12751275 }
12761276
1277+ [ Fact ]
1278+ public async Task CanSendGetModuleRequestAsync ( )
1279+ {
1280+ PSModuleMessage module =
1281+ await PsesLanguageClient
1282+ . SendRequest (
1283+ "powerShell/getModule" ,
1284+ new GetModuleParams
1285+ {
1286+ Name = "Microsoft.PowerShell.Management"
1287+ } )
1288+ . Returning < PSModuleMessage > ( CancellationToken . None ) ;
1289+
1290+ Assert . NotNull ( module ) ;
1291+ Assert . Equal ( "Microsoft.PowerShell.Management" , module . Name ) ;
1292+ Assert . NotEmpty ( module . Version ) ;
1293+ }
1294+
1295+ [ Fact ]
1296+ public async Task CanSendGetModuleRequestForMissingModuleAsync ( )
1297+ {
1298+ PSModuleMessage module =
1299+ await PsesLanguageClient
1300+ . SendRequest (
1301+ "powerShell/getModule" ,
1302+ new GetModuleParams
1303+ {
1304+ Name = "ThisModuleDoesNotExist-" + Guid . NewGuid ( ) . ToString ( "N" )
1305+ } )
1306+ . Returning < PSModuleMessage > ( CancellationToken . None ) ;
1307+
1308+ Assert . Null ( module ) ;
1309+ }
1310+
12771311 [ Fact ]
12781312 public async Task CanSendSemanticTokenRequestAsync ( )
12791313 {
You can’t perform that action at this time.
0 commit comments