File tree 1 file changed +16
-1
lines changed
test/PowerShellEditorServices.Test/Session 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 6
6
using System . Threading ;
7
7
using System . Threading . Tasks ;
8
8
using Microsoft . Extensions . Logging . Abstractions ;
9
- using Microsoft . PowerShell . EditorServices . Services . PowerShell . Host ;
10
9
using Microsoft . PowerShell . EditorServices . Services . PowerShell . Console ;
10
+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Execution ;
11
+ using Microsoft . PowerShell . EditorServices . Services . PowerShell . Host ;
11
12
using Xunit ;
12
13
13
14
namespace Microsoft . PowerShell . EditorServices . Test . Console
@@ -41,6 +42,20 @@ public async Task CanExecutePSCommand()
41
42
Assert . Equal ( "foo" , result [ 0 ] ) ;
42
43
}
43
44
45
+ [ Trait ( "Category" , "PsesInternalHost" ) ]
46
+ [ Fact ]
47
+ public async Task CanHandleThrow ( )
48
+ {
49
+ // TODO: Fix this so it doesn't throw!
50
+ _ = await Assert . ThrowsAsync < ArgumentOutOfRangeException > ( ( ) =>
51
+ {
52
+ return psesHost . ExecutePSCommandAsync (
53
+ new PSCommand ( ) . AddScript ( "throw" ) ,
54
+ CancellationToken . None ,
55
+ new PowerShellExecutionOptions { ThrowOnError = false } ) ;
56
+ } ) . ConfigureAwait ( true ) ;
57
+ }
58
+
44
59
[ Trait ( "Category" , "PsesInternalHost" ) ]
45
60
[ Fact ]
46
61
public async Task CanQueueParallelPSCommands ( )
You can’t perform that action at this time.
0 commit comments