@@ -4,16 +4,12 @@ namespace Microsoft.ComponentDetection.Orchestrator.Tests.Experiments;
44using System ;
55using System . Collections . Generic ;
66using System . IO ;
7- using System . Linq ;
87using System . Threading . Tasks ;
98using AwesomeAssertions ;
109using Microsoft . ComponentDetection . Common . DependencyGraph ;
1110using Microsoft . ComponentDetection . Contracts ;
1211using Microsoft . ComponentDetection . Contracts . BcdeModels ;
13- using Microsoft . ComponentDetection . Contracts . TypedComponent ;
14- using Microsoft . ComponentDetection . Detectors . CocoaPods ;
1512using Microsoft . ComponentDetection . Detectors . NuGet ;
16- using Microsoft . ComponentDetection . Detectors . Swift ;
1713using Microsoft . ComponentDetection . Orchestrator . Commands ;
1814using Microsoft . ComponentDetection . Orchestrator . Experiments ;
1915using Microsoft . ComponentDetection . Orchestrator . Experiments . Configs ;
@@ -169,69 +165,6 @@ public async Task FinishAsync_ProcessesExperimentsAsync()
169165 Times . Once ( ) ) ;
170166 }
171167
172- [ TestMethod ]
173- public async Task FinishAsync_ProcessesSwiftExperimentWithoutControlDetectorAsync ( )
174- {
175- var config = new SwiftDetectorExperiment ( ) ;
176- var swiftDetector = new SwiftResolvedComponentDetector ( null , null , null ) ;
177- var podDetector = new PodComponentDetector ( null , null , null ) ;
178- var service = new ExperimentService (
179- [ config ] ,
180- [ this . experimentProcessorMock . Object ] ,
181- this . graphTranslationServiceMock . Object ,
182- this . loggerMock . Object ) ;
183- service . RemoveUnwantedExperimentsbyDetectors ( [ podDetector ] ) ;
184-
185- this . SetupGraphMock ( [ ] ) ;
186- service . RecordDetectorRun ( this . detectorMock . Object , this . componentRecorder , this . scanSettingsMock . Object ) ;
187-
188- var component = new SwiftComponent
189- {
190- Name = "alamofire" ,
191- Version = "5.9.1" ,
192- RepositoryUrl = new Uri ( "https://github.com/Alamofire/Alamofire" ) ,
193- CommitHash = "f455c2975872ccd2d9c81594c658af65716e9b9a" ,
194- Kind = "remoteSourceControl" ,
195- } ;
196- this . SetupGraphMock ( [ new ScannedComponent { Component = component } ] ) ;
197- service . RecordDetectorRun ( swiftDetector , this . componentRecorder , this . scanSettingsMock . Object ) ;
198-
199- await service . FinishAsync ( ) ;
200-
201- this . experimentProcessorMock . Verify (
202- x => x . ProcessExperimentAsync (
203- config ,
204- It . Is < ExperimentDiff > ( diff =>
205- diff . AddedIds . Count == 1 && diff . AddedIds . Contains ( component . Id )
206- && diff . RemovedIds . Count == 0
207- && diff . ControlDetectors . Count == 0
208- && diff . ExperimentalDetectors . Count == 1
209- && diff . ExperimentalDetectors . Single ( ) . DetectorId == swiftDetector . Id ) ) ,
210- Times . Once ( ) ) ;
211- }
212-
213- [ TestMethod ]
214- public async Task FinishAsync_SkipsSwiftExperimentWithoutSwiftComponentsAsync ( )
215- {
216- var config = new SwiftDetectorExperiment ( ) ;
217- var service = new ExperimentService (
218- [ config ] ,
219- [ this . experimentProcessorMock . Object ] ,
220- this . graphTranslationServiceMock . Object ,
221- this . loggerMock . Object ) ;
222- this . SetupGraphMock ( ExperimentTestUtils . CreateRandomComponents ( ) ) ;
223- service . RecordDetectorRun ( new PodComponentDetector ( null , null , null ) , this . componentRecorder , this . scanSettingsMock . Object ) ;
224-
225- this . SetupGraphMock ( [ ] ) ;
226- service . RecordDetectorRun ( new SwiftResolvedComponentDetector ( null , null , null ) , this . componentRecorder , this . scanSettingsMock . Object ) ;
227-
228- await service . FinishAsync ( ) ;
229-
230- this . experimentProcessorMock . Verify (
231- x => x . ProcessExperimentAsync ( config , It . IsAny < ExperimentDiff > ( ) ) ,
232- Times . Never ( ) ) ;
233- }
234-
235168 [ TestMethod ]
236169 public async Task FinishAsync_SwallowsExceptionsAsync ( )
237170 {
0 commit comments