@@ -393,7 +393,7 @@ await debugService.SetLineBreakpointsAsync(
393393 debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
394394
395395 // Verify the breakpoint only broke at the condition ie. $i -eq breakpointValue1
396- var i = variables . FirstOrDefault ( v => v . Name == "$i" ) ;
396+ var i = Array . Find ( variables , v => v . Name == "$i" ) ;
397397 Assert . NotNull ( i ) ;
398398 Assert . False ( i . IsExpandable ) ;
399399 Assert . Equal ( $ "{ hitCount } ", i . ValueString ) ;
@@ -653,14 +653,14 @@ await debugService.SetLineBreakpointsAsync(
653653 VariableScope [ ] scopes = debugService . GetVariableScopes ( 0 ) ;
654654
655655 // Test set of script scope bool variable (strongly typed)
656- VariableScope scriptScope = scopes . FirstOrDefault ( s => s . Name == VariableContainerDetails . ScriptScopeName ) ;
656+ VariableScope scriptScope = Array . Find ( scopes , s => s . Name == VariableContainerDetails . ScriptScopeName ) ;
657657 string newBoolValue = "$true" ;
658658 string newBoolExpr = "1" ;
659659 string setBoolValue = await debugService . SetVariableAsync ( scriptScope . Id , "$scriptBool" , newBoolExpr ) . ConfigureAwait ( false ) ;
660660 Assert . Equal ( newBoolValue , setBoolValue ) ;
661661
662662 // Test set of global scope ActionPreference variable (strongly typed)
663- VariableScope globalScope = scopes . FirstOrDefault ( s => s . Name == VariableContainerDetails . GlobalScopeName ) ;
663+ VariableScope globalScope = Array . Find ( scopes , s => s . Name == VariableContainerDetails . GlobalScopeName ) ;
664664 string newGlobalValue = "Continue" ;
665665 string newGlobalExpr = "'Continue'" ;
666666 string setGlobalValue = await debugService . SetVariableAsync ( globalScope . Id , "$VerbosePreference" , newGlobalExpr ) . ConfigureAwait ( false ) ;
@@ -675,21 +675,21 @@ await debugService.SetLineBreakpointsAsync(
675675
676676 // Test set of a local string variable (not strongly typed but force conversion)
677677 variables = debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
678- var strVar = variables . FirstOrDefault ( v => v . Name == "$strVar2" ) ;
678+ var strVar = Array . Find ( variables , v => v . Name == "$strVar2" ) ;
679679 Assert . Equal ( newStrValue , strVar . ValueString ) ;
680680
681681 scopes = debugService . GetVariableScopes ( 0 ) ;
682682
683683 // Test set of script scope bool variable (strongly typed)
684- scriptScope = scopes . FirstOrDefault ( s => s . Name == VariableContainerDetails . ScriptScopeName ) ;
684+ scriptScope = Array . Find ( scopes , s => s . Name == VariableContainerDetails . ScriptScopeName ) ;
685685 variables = debugService . GetVariables ( scriptScope . Id ) ;
686- var boolVar = variables . FirstOrDefault ( v => v . Name == "$scriptBool" ) ;
686+ var boolVar = Array . Find ( variables , v => v . Name == "$scriptBool" ) ;
687687 Assert . Equal ( newBoolValue , boolVar . ValueString ) ;
688688
689689 // Test set of global scope ActionPreference variable (strongly typed)
690- globalScope = scopes . FirstOrDefault ( s => s . Name == VariableContainerDetails . GlobalScopeName ) ;
690+ globalScope = Array . Find ( scopes , s => s . Name == VariableContainerDetails . GlobalScopeName ) ;
691691 variables = debugService . GetVariables ( globalScope . Id ) ;
692- var globalVar = variables . FirstOrDefault ( v => v . Name == "$VerbosePreference" ) ;
692+ var globalVar = Array . Find ( variables , v => v . Name == "$VerbosePreference" ) ;
693693 Assert . Equal ( newGlobalValue , globalVar . ValueString ) ;
694694 }
695695
@@ -713,7 +713,7 @@ await debugService.SetLineBreakpointsAsync(
713713 VariableDetailsBase [ ] variables =
714714 debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
715715
716- var var = variables . FirstOrDefault ( v => v . Name == "$enumVar" ) ;
716+ var var = Array . Find ( variables , v => v . Name == "$enumVar" ) ;
717717 Assert . NotNull ( var ) ;
718718 Assert . Equal ( "Continue" , var . ValueString ) ;
719719 Assert . False ( var . IsExpandable ) ;
@@ -739,7 +739,7 @@ await debugService.SetLineBreakpointsAsync(
739739 VariableDetailsBase [ ] variables =
740740 debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
741741
742- VariableDetailsBase var = variables . FirstOrDefault ( v => v . Name == "$assocArrVar" ) ;
742+ VariableDetailsBase var = Array . Find ( variables , v => v . Name == "$assocArrVar" ) ;
743743 Assert . NotNull ( var ) ;
744744 Assert . Equal ( "[Hashtable: 2]" , var . ValueString ) ;
745745 Assert . True ( var . IsExpandable ) ;
@@ -781,7 +781,7 @@ await debugService.SetLineBreakpointsAsync(
781781 VariableDetailsBase [ ] variables =
782782 debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
783783
784- var nullStringVar = variables . FirstOrDefault ( v => v . Name == "$nullString" ) ;
784+ var nullStringVar = Array . Find ( variables , v => v . Name == "$nullString" ) ;
785785 Assert . NotNull ( nullStringVar ) ;
786786 Assert . Equal ( "[NullString]" , nullStringVar . ValueString ) ;
787787 Assert . True ( nullStringVar . IsExpandable ) ;
@@ -807,7 +807,7 @@ await debugService.SetLineBreakpointsAsync(
807807 VariableDetailsBase [ ] variables =
808808 debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
809809
810- var psObjVar = variables . FirstOrDefault ( v => v . Name == "$psObjVar" ) ;
810+ var psObjVar = Array . Find ( variables , v => v . Name == "$psObjVar" ) ;
811811 Assert . NotNull ( psObjVar ) ;
812812 Assert . True ( "@{Age=75; Name=John}" . Equals ( psObjVar . ValueString ) || "@{Name=John; Age=75}" . Equals ( psObjVar . ValueString ) ) ;
813813 Assert . True ( psObjVar . IsExpandable ) ;
@@ -840,7 +840,7 @@ await debugService.SetLineBreakpointsAsync(
840840 VariableDetailsBase [ ] variables =
841841 debugService . GetVariables ( stackFrames [ 0 ] . AutoVariables . Id ) ;
842842
843- var var = variables . FirstOrDefault ( v => v . Name == "$psCustomObjVar" ) ;
843+ var var = Array . Find ( variables , v => v . Name == "$psCustomObjVar" ) ;
844844 Assert . NotNull ( var ) ;
845845 Assert . Equal ( "@{Name=Paul; Age=73}" , var . ValueString ) ;
846846 Assert . True ( var . IsExpandable ) ;
0 commit comments