@@ -55,6 +55,7 @@ struct TestData
5555 public IConnection Connection ;
5656 public IApiClient ApiClient ;
5757 public IModelService ModelService ;
58+ public IAutoCompleteAdvisor AutoCompleteAdvisor { get ; set ; }
5859
5960 public IModelServiceFactory GetModelServiceFactory ( )
6061 {
@@ -78,6 +79,7 @@ static TestData PrepareTestData(
7879 var connection = Substitute . For < IConnection > ( ) ;
7980 var api = Substitute . For < IApiClient > ( ) ;
8081 var ms = Substitute . For < IModelService > ( ) ;
82+ var autoCompleteAdvisor = Substitute . For < IAutoCompleteAdvisor > ( ) ;
8183
8284 connection . HostAddress . Returns ( HostAddress . Create ( "https://github.com" ) ) ;
8385
@@ -121,7 +123,8 @@ static TestData PrepareTestData(
121123 NotificationService = notifications ,
122124 Connection = connection ,
123125 ApiClient = api ,
124- ModelService = ms
126+ ModelService = ms ,
127+ AutoCompleteAdvisor = autoCompleteAdvisor
125128 } ;
126129 }
127130
@@ -147,7 +150,7 @@ public async Task TargetBranchDisplayNameIncludesRepoOwnerWhenForkAsync()
147150 var prservice = new PullRequestService ( data . GitClient , data . GitService , Substitute . For < IVSGitExt > ( ) , Substitute . For < IGraphQLClientFactory > ( ) , data . ServiceProvider . GetOperatingSystem ( ) , Substitute . For < IUsageTracker > ( ) ) ;
148151 prservice . GetPullRequestTemplate ( data . ActiveRepo ) . Returns ( Observable . Empty < string > ( ) ) ;
149152 var vm = new PullRequestCreationViewModel ( data . GetModelServiceFactory ( ) , prservice , data . NotificationService ,
150- Substitute . For < IMessageDraftStore > ( ) , data . GitService ) ;
153+ Substitute . For < IMessageDraftStore > ( ) , data . GitService , data . AutoCompleteAdvisor ) ;
151154 await vm . InitializeAsync ( data . ActiveRepo , data . Connection ) ;
152155 Assert . That ( "octokit/master" , Is . EqualTo ( vm . TargetBranch . DisplayName ) ) ;
153156 }
@@ -183,7 +186,7 @@ public async Task CreatingPRsAsync(
183186
184187 var prservice = new PullRequestService ( data . GitClient , data . GitService , Substitute . For < IVSGitExt > ( ) , Substitute . For < IGraphQLClientFactory > ( ) , data . ServiceProvider . GetOperatingSystem ( ) , Substitute . For < IUsageTracker > ( ) ) ;
185188 var vm = new PullRequestCreationViewModel ( data . GetModelServiceFactory ( ) , prservice , data . NotificationService ,
186- Substitute . For < IMessageDraftStore > ( ) , data . GitService ) ;
189+ Substitute . For < IMessageDraftStore > ( ) , data . GitService , data . AutoCompleteAdvisor ) ;
187190 await vm . InitializeAsync ( data . ActiveRepo , data . Connection ) ;
188191
189192 // the TargetBranch property gets set to whatever the repo default is (we assume master here),
@@ -226,7 +229,7 @@ public async Task TemplateIsUsedIfPresentAsync()
226229 prservice . GetPullRequestTemplate ( data . ActiveRepo ) . Returns ( Observable . Return ( "Test PR template" ) ) ;
227230
228231 var vm = new PullRequestCreationViewModel ( data . GetModelServiceFactory ( ) , prservice , data . NotificationService ,
229- Substitute . For < IMessageDraftStore > ( ) , data . GitService ) ;
232+ Substitute . For < IMessageDraftStore > ( ) , data . GitService , data . AutoCompleteAdvisor ) ;
230233 await vm . InitializeAsync ( data . ActiveRepo , data . Connection ) ;
231234
232235 Assert . That ( "Test PR template" , Is . EqualTo ( vm . Description ) ) ;
@@ -246,7 +249,7 @@ public async Task LoadsDraft()
246249
247250 var prservice = Substitute . For < IPullRequestService > ( ) ;
248251 var vm = new PullRequestCreationViewModel ( data . GetModelServiceFactory ( ) , prservice , data . NotificationService ,
249- draftStore , data . GitService ) ;
252+ draftStore , data . GitService , data . AutoCompleteAdvisor ) ;
250253 await vm . InitializeAsync ( data . ActiveRepo , data . Connection ) ;
251254
252255 Assert . That ( vm . PRTitle , Is . EqualTo ( "This is a Title." ) ) ;
@@ -261,7 +264,7 @@ public async Task UpdatesDraftWhenDescriptionChanges()
261264 var draftStore = Substitute . For < IMessageDraftStore > ( ) ;
262265 var prservice = Substitute . For < IPullRequestService > ( ) ;
263266 var vm = new PullRequestCreationViewModel ( data . GetModelServiceFactory ( ) , prservice , data . NotificationService ,
264- draftStore , data . GitService , scheduler ) ;
267+ draftStore , data . GitService , data . AutoCompleteAdvisor , scheduler ) ;
265268 await vm . InitializeAsync ( data . ActiveRepo , data . Connection ) ;
266269
267270 vm . Description = "Body changed." ;
@@ -284,7 +287,7 @@ public async Task UpdatesDraftWhenTitleChanges()
284287 var draftStore = Substitute . For < IMessageDraftStore > ( ) ;
285288 var prservice = Substitute . For < IPullRequestService > ( ) ;
286289 var vm = new PullRequestCreationViewModel ( data . GetModelServiceFactory ( ) , prservice , data . NotificationService ,
287- draftStore , data . GitService , scheduler ) ;
290+ draftStore , data . GitService , data . AutoCompleteAdvisor , scheduler ) ;
288291 await vm . InitializeAsync ( data . ActiveRepo , data . Connection ) ;
289292
290293 vm . PRTitle = "Title changed." ;
@@ -307,7 +310,7 @@ public async Task DeletesDraftWhenPullRequestSubmitted()
307310 var draftStore = Substitute . For < IMessageDraftStore > ( ) ;
308311 var prservice = Substitute . For < IPullRequestService > ( ) ;
309312 var vm = new PullRequestCreationViewModel ( data . GetModelServiceFactory ( ) , prservice , data . NotificationService , draftStore ,
310- data . GitService , scheduler ) ;
313+ data . GitService , data . AutoCompleteAdvisor , scheduler ) ;
311314 await vm . InitializeAsync ( data . ActiveRepo , data . Connection ) ;
312315
313316 await vm . CreatePullRequest . Execute ( ) ;
@@ -323,7 +326,7 @@ public async Task DeletesDraftWhenCanceled()
323326 var draftStore = Substitute . For < IMessageDraftStore > ( ) ;
324327 var prservice = Substitute . For < IPullRequestService > ( ) ;
325328 var vm = new PullRequestCreationViewModel ( data . GetModelServiceFactory ( ) , prservice , data . NotificationService , draftStore ,
326- data . GitService , scheduler ) ;
329+ data . GitService , data . AutoCompleteAdvisor , scheduler ) ;
327330 await vm . InitializeAsync ( data . ActiveRepo , data . Connection ) ;
328331
329332 await vm . Cancel . Execute ( ) ;
0 commit comments