@@ -29,11 +29,11 @@ public async Task GetMgGraphAccessTokenAsync_WithValidClientAppId_IncludesClient
2929 var clientAppId = "87654321-4321-4321-4321-cba987654321" ;
3030 var expectedToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.signature" ;
3131
32- _executor . ExecuteAsync (
32+ _executor . ExecuteWithStreamingAsync (
3333 Arg . Any < string > ( ) ,
3434 Arg . Is < string > ( args => args . Contains ( $ "-ClientId '{ clientAppId } '") ) ,
3535 Arg . Any < string ? > ( ) ,
36- Arg . Any < bool > ( ) ,
36+ Arg . Any < string > ( ) ,
3737 Arg . Any < bool > ( ) ,
3838 Arg . Any < CancellationToken > ( ) )
3939 . Returns ( new CommandResult { ExitCode = 0 , StandardOutput = expectedToken , StandardError = string . Empty } ) ;
@@ -45,11 +45,11 @@ public async Task GetMgGraphAccessTokenAsync_WithValidClientAppId_IncludesClient
4545
4646 // Assert
4747 token . Should ( ) . Be ( expectedToken ) ;
48- await _executor . Received ( 1 ) . ExecuteAsync (
48+ await _executor . Received ( 1 ) . ExecuteWithStreamingAsync (
4949 Arg . Is < string > ( cmd => cmd == "pwsh" || cmd == "powershell" ) ,
5050 Arg . Is < string > ( args => args . Contains ( $ "-ClientId '{ clientAppId } '") ) ,
5151 Arg . Any < string ? > ( ) ,
52- Arg . Any < bool > ( ) ,
52+ Arg . Any < string > ( ) ,
5353 Arg . Any < bool > ( ) ,
5454 Arg . Any < CancellationToken > ( ) ) ;
5555 }
@@ -62,11 +62,11 @@ public async Task GetMgGraphAccessTokenAsync_WithoutClientAppId_OmitsClientIdPar
6262 var scopes = new [ ] { "User.Read" } ;
6363 var expectedToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.signature" ;
6464
65- _executor . ExecuteAsync (
65+ _executor . ExecuteWithStreamingAsync (
6666 Arg . Any < string > ( ) ,
6767 Arg . Is < string > ( args => ! args . Contains ( "-ClientId" ) ) ,
6868 Arg . Any < string ? > ( ) ,
69- Arg . Any < bool > ( ) ,
69+ Arg . Any < string > ( ) ,
7070 Arg . Any < bool > ( ) ,
7171 Arg . Any < CancellationToken > ( ) )
7272 . Returns ( new CommandResult { ExitCode = 0 , StandardOutput = expectedToken , StandardError = string . Empty } ) ;
@@ -78,11 +78,11 @@ public async Task GetMgGraphAccessTokenAsync_WithoutClientAppId_OmitsClientIdPar
7878
7979 // Assert
8080 token . Should ( ) . Be ( expectedToken ) ;
81- await _executor . Received ( 1 ) . ExecuteAsync (
81+ await _executor . Received ( 1 ) . ExecuteWithStreamingAsync (
8282 Arg . Any < string > ( ) ,
8383 Arg . Is < string > ( args => ! args . Contains ( "-ClientId" ) ) ,
8484 Arg . Any < string ? > ( ) ,
85- Arg . Any < bool > ( ) ,
85+ Arg . Any < string > ( ) ,
8686 Arg . Any < bool > ( ) ,
8787 Arg . Any < CancellationToken > ( ) ) ;
8888 }
@@ -152,11 +152,11 @@ public async Task GetMgGraphAccessTokenAsync_WhenExecutionFails_ReturnsNull()
152152 var tenantId = "12345678-1234-1234-1234-123456789abc" ;
153153 var scopes = new [ ] { "User.Read" } ;
154154
155- _executor . ExecuteAsync (
155+ _executor . ExecuteWithStreamingAsync (
156156 Arg . Any < string > ( ) ,
157157 Arg . Any < string > ( ) ,
158158 Arg . Any < string ? > ( ) ,
159- Arg . Any < bool > ( ) ,
159+ Arg . Any < string > ( ) ,
160160 Arg . Any < bool > ( ) ,
161161 Arg . Any < CancellationToken > ( ) )
162162 . Returns ( new CommandResult { ExitCode = 1 , StandardOutput = string . Empty , StandardError = "PowerShell error" } ) ;
@@ -178,11 +178,11 @@ public async Task GetMgGraphAccessTokenAsync_WithValidToken_ReturnsToken()
178178 var scopes = new [ ] { "User.Read" } ;
179179 var expectedToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.signature" ;
180180
181- _executor . ExecuteAsync (
181+ _executor . ExecuteWithStreamingAsync (
182182 Arg . Any < string > ( ) ,
183183 Arg . Any < string > ( ) ,
184184 Arg . Any < string ? > ( ) ,
185- Arg . Any < bool > ( ) ,
185+ Arg . Any < string > ( ) ,
186186 Arg . Any < bool > ( ) ,
187187 Arg . Any < CancellationToken > ( ) )
188188 . Returns ( new CommandResult { ExitCode = 0 , StandardOutput = expectedToken , StandardError = string . Empty } ) ;
@@ -223,11 +223,11 @@ public async Task GetMgGraphAccessTokenAsync_EscapesSingleQuotesInClientAppId()
223223 var clientAppId = "87654321-4321-4321-4321-cba987654321" ;
224224 var expectedToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.signature" ;
225225
226- _executor . ExecuteAsync (
226+ _executor . ExecuteWithStreamingAsync (
227227 Arg . Any < string > ( ) ,
228228 Arg . Is < string > ( args => ! args . Contains ( "''" ) ) , // Should not have escaped quotes for valid GUID
229229 Arg . Any < string ? > ( ) ,
230- Arg . Any < bool > ( ) ,
230+ Arg . Any < string > ( ) ,
231231 Arg . Any < bool > ( ) ,
232232 Arg . Any < CancellationToken > ( ) )
233233 . Returns ( new CommandResult { ExitCode = 0 , StandardOutput = expectedToken , StandardError = string . Empty } ) ;
0 commit comments