@@ -869,7 +869,7 @@ public async Task GoModDetector_GoModFileFound_GoModParserIsExecuted()
869869
870870 scanResult . ResultCode . Should ( ) . Be ( ProcessingResultCode . Success ) ;
871871
872- goModParserMock . Verify ( parser => parser . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) , Times . Once ) ;
872+ goModParserMock . Verify ( parser => parser . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) , Times . Once ) ;
873873 }
874874
875875 /// <summary>
@@ -888,10 +888,10 @@ public async Task GoDetector_GoSum_GoSumParserExecuted(bool goCliSucceeds)
888888 this . envVarService . Setup ( x => x . IsEnvironmentVariableValueTrue ( "DisableGoCliScan" ) ) . Returns ( false ) ;
889889
890890 // Setup go cli parser to succeed/fail
891- this . mockGoCliParser . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) ) . ReturnsAsync ( goCliSucceeds ) ;
891+ this . mockGoCliParser . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) ) . ReturnsAsync ( goCliSucceeds ) ;
892892
893893 // Setup go sum parser to succeed
894- this . mockGoSumParser . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) ) . ReturnsAsync ( true ) ;
894+ this . mockGoSumParser . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) ) . ReturnsAsync ( true ) ;
895895 var ( scanResult , componentRecorder ) = await this . DetectorTestUtility
896896 . WithFile ( "go.sum" , string . Empty )
897897 . ExecuteDetectorAsync ( ) ;
@@ -913,8 +913,8 @@ public async Task GoDetector_GoSum_GoSumParserExecutedIfCliDisabled()
913913 // Setup environment variable to disable CLI scan
914914 this . envVarService . Setup ( s => s . IsEnvironmentVariableValueTrue ( "DisableGoCliScan" ) ) . Returns ( true ) ;
915915
916- // Setup go sum parser to succed
917- goSumParserMock . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) ) . ReturnsAsync ( true ) ;
916+ // Setup go sum parser to succeed
917+ goSumParserMock . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) ) . ReturnsAsync ( true ) ;
918918
919919 var ( scanResult , componentRecorder ) = await this . DetectorTestUtility
920920 . WithFile ( "go.sum" , string . Empty )
@@ -941,7 +941,7 @@ public async Task GoModDetector_ExecutingGoVersionFails_DetectorDoesNotFail()
941941
942942 scanResult . ResultCode . Should ( ) . Be ( ProcessingResultCode . Success ) ;
943943
944- this . mockGoModParser . Verify ( parser => parser . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) , Times . Once ) ;
944+ this . mockGoModParser . Verify ( parser => parser . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) , Times . Once ) ;
945945 }
946946
947947 [ TestMethod ]
@@ -996,9 +996,9 @@ public async Task GoDetector_GoMod_VerifyNestedRootsUnderGTE117_AreSkipped()
996996 var processedFiles = new List < string > ( ) ;
997997 this . SetupMockGoModParser ( ) ;
998998 this . mockGoModParser
999- . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) )
999+ . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) )
10001000 . ReturnsAsync ( true )
1001- . Callback < ISingleFileComponentRecorder , IComponentStream , GoGraphTelemetryRecord > ( ( _ , file , record ) =>
1001+ . Callback < ISingleFileComponentRecorder , IComponentStream , GoGraphTelemetryRecord , CancellationToken > ( ( _ , file , record , _ ) =>
10021002 {
10031003 processedFiles . Add ( file . Location ) ;
10041004 record . GoModVersion = "1.18" ;
@@ -1031,9 +1031,9 @@ public async Task GoDetector_GoMod_VerifyNestedRootsUnderLT117AreNotSkipped()
10311031 var processedFiles = new List < string > ( ) ;
10321032 this . SetupMockGoModParser ( ) ;
10331033 this . mockGoModParser
1034- . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) )
1034+ . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) )
10351035 . ReturnsAsync ( true )
1036- . Callback < ISingleFileComponentRecorder , IComponentStream , GoGraphTelemetryRecord > ( ( _ , file , record ) =>
1036+ . Callback < ISingleFileComponentRecorder , IComponentStream , GoGraphTelemetryRecord , CancellationToken > ( ( _ , file , record , _ ) =>
10371037 {
10381038 processedFiles . Add ( file . Location ) ;
10391039 var rootMod = Path . Combine ( root , "go.mod" ) ;
@@ -1080,8 +1080,8 @@ public async Task GoDetector_GoMod_VerifyNestedRootsAreNotSkippedIfParentParseFa
10801080 this . SetupMockGoModParser ( ) ;
10811081
10821082 this . mockGoModParser
1083- . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) )
1084- . ReturnsAsync ( ( ISingleFileComponentRecorder recorder , IComponentStream file , GoGraphTelemetryRecord record ) =>
1083+ . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) )
1084+ . ReturnsAsync ( ( ISingleFileComponentRecorder recorder , IComponentStream file , GoGraphTelemetryRecord record , CancellationToken cancellationToken ) =>
10851085 {
10861086 processedFiles . Add ( file . Location ) ;
10871087 var aMod = Path . Combine ( root , "a" , "go.mod" ) ;
@@ -1134,9 +1134,9 @@ public async Task GoDetector_GoSum_VerifyNestedRootsUnderGoSum_AreSkipped()
11341134 this . envVarService . Setup ( x => x . IsEnvironmentVariableValueTrue ( "DisableGoCliScan" ) ) . Returns ( false ) ;
11351135 this . SetupMockGoCLIParser ( ) ;
11361136 this . mockGoCliParser
1137- . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) )
1137+ . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) )
11381138 . ReturnsAsync ( true )
1139- . Callback < ISingleFileComponentRecorder , IComponentStream , GoGraphTelemetryRecord > ( ( _ , file , record ) =>
1139+ . Callback < ISingleFileComponentRecorder , IComponentStream , GoGraphTelemetryRecord , CancellationToken > ( ( _ , file , record , _ ) =>
11401140 {
11411141 processedFiles . Add ( file . Location ) ;
11421142 } ) ;
@@ -1167,8 +1167,8 @@ public async Task GoDetector_GoSum_VerifyNestedRootsAreNotSkippedIfParentParseFa
11671167 this . SetupMockGoSumParser ( ) ;
11681168
11691169 this . mockGoModParser
1170- . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) )
1171- . ReturnsAsync ( ( ISingleFileComponentRecorder recorder , IComponentStream file , GoGraphTelemetryRecord record ) =>
1170+ . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) )
1171+ . ReturnsAsync ( ( ISingleFileComponentRecorder recorder , IComponentStream file , GoGraphTelemetryRecord record , CancellationToken cancellationToken ) =>
11721172 {
11731173 processedFiles . Add ( file . Location ) ;
11741174 var bMod = Path . Combine ( root , "b" , "go.mod" ) ;
@@ -1182,8 +1182,8 @@ public async Task GoDetector_GoSum_VerifyNestedRootsAreNotSkippedIfParentParseFa
11821182 } ) ;
11831183
11841184 this . mockGoCliParser
1185- . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) ) )
1186- . ReturnsAsync ( ( ISingleFileComponentRecorder recorder , IComponentStream file , GoGraphTelemetryRecord record ) =>
1185+ . Setup ( p => p . ParseAsync ( It . IsAny < ISingleFileComponentRecorder > ( ) , It . IsAny < IComponentStream > ( ) , It . IsAny < GoGraphTelemetryRecord > ( ) , It . IsAny < CancellationToken > ( ) ) )
1186+ . ReturnsAsync ( ( ISingleFileComponentRecorder recorder , IComponentStream file , GoGraphTelemetryRecord record , CancellationToken cancellationToken ) =>
11871187 {
11881188 processedFiles . Add ( file . Location ) ;
11891189 return file . Location != Path . Combine ( root , "a" , "go.sum" ) ;
0 commit comments