@@ -203,7 +203,7 @@ await debugService.SetCommandBreakpointsAsync(
203
203
[ MemberData ( nameof ( DebuggerAcceptsScriptArgsTestData ) ) ]
204
204
public async Task DebuggerAcceptsScriptArgs ( string [ ] args )
205
205
{
206
- IEnumerable < BreakpointDetails > breakpoints = await debugService . SetLineBreakpointsAsync (
206
+ IReadOnlyList < BreakpointDetails > breakpoints = await debugService . SetLineBreakpointsAsync (
207
207
oddPathScriptFile ,
208
208
new [ ] { BreakpointDetails . Create ( oddPathScriptFile . FilePath , 3 ) } ) . ConfigureAwait ( true ) ;
209
209
@@ -257,15 +257,15 @@ public async Task DebuggerAcceptsScriptArgs(string[] args)
257
257
[ Fact ]
258
258
public async Task DebuggerSetsAndClearsFunctionBreakpoints ( )
259
259
{
260
- CommandBreakpointDetails [ ] breakpoints = await debugService . SetCommandBreakpointsAsync (
260
+ IReadOnlyList < CommandBreakpointDetails > breakpoints = await debugService . SetCommandBreakpointsAsync (
261
261
new [ ] {
262
262
CommandBreakpointDetails . Create ( "Write-Host" ) ,
263
263
CommandBreakpointDetails . Create ( "Get-Date" )
264
264
} ) . ConfigureAwait ( true ) ;
265
265
266
- Assert . Equal ( 2 , breakpoints . Length ) ;
267
- Assert . Equal ( "Write-Host" , breakpoints . ElementAt ( 0 ) . Name ) ;
268
- Assert . Equal ( "Get-Date" , breakpoints . ElementAt ( 1 ) . Name ) ;
266
+ Assert . Equal ( 2 , breakpoints . Count ) ;
267
+ Assert . Equal ( "Write-Host" , breakpoints [ 0 ] . Name ) ;
268
+ Assert . Equal ( "Get-Date" , breakpoints [ 1 ] . Name ) ;
269
269
270
270
breakpoints = await debugService . SetCommandBreakpointsAsync (
271
271
new [ ] { CommandBreakpointDetails . Create ( "Get-Host" ) } ) . ConfigureAwait ( true ) ;
@@ -281,7 +281,7 @@ public async Task DebuggerSetsAndClearsFunctionBreakpoints()
281
281
[ Fact ]
282
282
public async Task DebuggerStopsOnFunctionBreakpoints ( )
283
283
{
284
- CommandBreakpointDetails [ ] breakpoints = await debugService . SetCommandBreakpointsAsync (
284
+ IReadOnlyList < CommandBreakpointDetails > breakpoints = await debugService . SetCommandBreakpointsAsync (
285
285
new [ ] { CommandBreakpointDetails . Create ( "Write-Host" ) } ) . ConfigureAwait ( true ) ;
286
286
287
287
Task _ = ExecuteDebugFileAsync ( ) ;
@@ -311,7 +311,7 @@ public async Task DebuggerStopsOnFunctionBreakpoints()
311
311
[ Fact ]
312
312
public async Task DebuggerSetsAndClearsLineBreakpoints ( )
313
313
{
314
- IEnumerable < BreakpointDetails > breakpoints =
314
+ IReadOnlyList < BreakpointDetails > breakpoints =
315
315
await debugService . SetLineBreakpointsAsync (
316
316
debugScriptFile ,
317
317
new [ ] {
@@ -322,16 +322,16 @@ await debugService.SetLineBreakpointsAsync(
322
322
IReadOnlyList < LineBreakpoint > confirmedBreakpoints = await GetConfirmedBreakpoints ( debugScriptFile ) . ConfigureAwait ( true ) ;
323
323
324
324
Assert . Equal ( 2 , confirmedBreakpoints . Count ) ;
325
- Assert . Equal ( 5 , breakpoints . ElementAt ( 0 ) . LineNumber ) ;
326
- Assert . Equal ( 10 , breakpoints . ElementAt ( 1 ) . LineNumber ) ;
325
+ Assert . Equal ( 5 , breakpoints [ 0 ] . LineNumber ) ;
326
+ Assert . Equal ( 10 , breakpoints [ 1 ] . LineNumber ) ;
327
327
328
328
breakpoints = await debugService . SetLineBreakpointsAsync (
329
329
debugScriptFile ,
330
330
new [ ] { BreakpointDetails . Create ( debugScriptFile . FilePath , 2 ) } ) . ConfigureAwait ( true ) ;
331
331
confirmedBreakpoints = await GetConfirmedBreakpoints ( debugScriptFile ) . ConfigureAwait ( true ) ;
332
332
333
333
Assert . Single ( confirmedBreakpoints ) ;
334
- Assert . Equal ( 2 , breakpoints . ElementAt ( 0 ) . LineNumber ) ;
334
+ Assert . Equal ( 2 , breakpoints [ 0 ] . LineNumber ) ;
335
335
336
336
await debugService . SetLineBreakpointsAsync (
337
337
debugScriptFile ,
@@ -442,7 +442,7 @@ await debugService.SetLineBreakpointsAsync(
442
442
[ Fact ]
443
443
public async Task DebuggerProvidesMessageForInvalidConditionalBreakpoint ( )
444
444
{
445
- IEnumerable < BreakpointDetails > breakpoints =
445
+ IReadOnlyList < BreakpointDetails > breakpoints =
446
446
await debugService . SetLineBreakpointsAsync (
447
447
debugScriptFile ,
448
448
new [ ] {
@@ -457,36 +457,36 @@ await debugService.SetLineBreakpointsAsync(
457
457
} ) . ConfigureAwait ( true ) ;
458
458
459
459
Assert . Single ( breakpoints ) ;
460
- // Assert.Equal(5, breakpoints.ElementAt(0) .LineNumber);
461
- // Assert.True(breakpoints.ElementAt(0) .Verified);
462
- // Assert.Null(breakpoints.ElementAt(0) .Message);
463
-
464
- Assert . Equal ( 10 , breakpoints . ElementAt ( 0 ) . LineNumber ) ;
465
- Assert . False ( breakpoints . ElementAt ( 0 ) . Verified ) ;
466
- Assert . NotNull ( breakpoints . ElementAt ( 0 ) . Message ) ;
467
- Assert . Contains ( "Unexpected token '-ez'" , breakpoints . ElementAt ( 0 ) . Message ) ;
460
+ // Assert.Equal(5, breakpoints[0] .LineNumber);
461
+ // Assert.True(breakpoints[0] .Verified);
462
+ // Assert.Null(breakpoints[0] .Message);
463
+
464
+ Assert . Equal ( 10 , breakpoints [ 0 ] . LineNumber ) ;
465
+ Assert . False ( breakpoints [ 0 ] . Verified ) ;
466
+ Assert . NotNull ( breakpoints [ 0 ] . Message ) ;
467
+ Assert . Contains ( "Unexpected token '-ez'" , breakpoints [ 0 ] . Message ) ;
468
468
}
469
469
470
470
[ Fact ]
471
471
public async Task DebuggerFindsParsableButInvalidSimpleBreakpointConditions ( )
472
472
{
473
- IEnumerable < BreakpointDetails > breakpoints =
473
+ IReadOnlyList < BreakpointDetails > breakpoints =
474
474
await debugService . SetLineBreakpointsAsync (
475
475
debugScriptFile ,
476
476
new [ ] {
477
477
BreakpointDetails . Create ( debugScriptFile . FilePath , 5 , column : null , condition : "$i == 100" ) ,
478
478
BreakpointDetails . Create ( debugScriptFile . FilePath , 7 , column : null , condition : "$i > 100" )
479
479
} ) . ConfigureAwait ( true ) ;
480
480
481
- Assert . Equal ( 2 , breakpoints . Count ( ) ) ;
482
- Assert . Equal ( 5 , breakpoints . ElementAt ( 0 ) . LineNumber ) ;
483
- Assert . False ( breakpoints . ElementAt ( 0 ) . Verified ) ;
484
- Assert . Contains ( "Use '-eq' instead of '=='" , breakpoints . ElementAt ( 0 ) . Message ) ;
481
+ Assert . Equal ( 2 , breakpoints . Count ) ;
482
+ Assert . Equal ( 5 , breakpoints [ 0 ] . LineNumber ) ;
483
+ Assert . False ( breakpoints [ 0 ] . Verified ) ;
484
+ Assert . Contains ( "Use '-eq' instead of '=='" , breakpoints [ 0 ] . Message ) ;
485
485
486
- Assert . Equal ( 7 , breakpoints . ElementAt ( 1 ) . LineNumber ) ;
487
- Assert . False ( breakpoints . ElementAt ( 1 ) . Verified ) ;
488
- Assert . NotNull ( breakpoints . ElementAt ( 1 ) . Message ) ;
489
- Assert . Contains ( "Use '-gt' instead of '>'" , breakpoints . ElementAt ( 1 ) . Message ) ;
486
+ Assert . Equal ( 7 , breakpoints [ 1 ] . LineNumber ) ;
487
+ Assert . False ( breakpoints [ 1 ] . Verified ) ;
488
+ Assert . NotNull ( breakpoints [ 1 ] . Message ) ;
489
+ Assert . Contains ( "Use '-gt' instead of '>'" , breakpoints [ 1 ] . Message ) ;
490
490
}
491
491
492
492
[ Fact ]
0 commit comments