@@ -19,14 +19,15 @@ public class VSGitExtTests
1919{
2020 public class TheConstructor : TestBaseClass
2121 {
22- [ TestCase ( true , 1 ) ]
23- [ TestCase ( false , 0 ) ]
24- public void GetServiceIGitExt_WhenRepositoryOpenIsActive ( bool isActive , int expectCalls )
22+ [ TestCase ( true , Guids . GitSccProviderId , 1 ) ]
23+ [ TestCase ( true , UICONTEXT . RepositoryOpen_string , 0 , Description = "No longer using RepositoryOpen" ) ]
24+ [ TestCase ( false , Guids . GitSccProviderId , 0 ) ]
25+ public void GetServiceIGitExt_WhenGitSccProviderIsActive ( bool isActive , string contextGuidString , int expectCalls )
2526 {
2627 var context = CreateVSUIContext ( isActive ) ;
2728 var sp = Substitute . For < IAsyncServiceProvider > ( ) ;
2829
29- var target = CreateVSGitExt ( context , sp : sp ) ;
30+ var target = CreateVSGitExt ( context , sp : sp , contextGuidString : contextGuidString ) ;
3031
3132 sp . Received ( expectCalls ) . GetServiceAsync ( typeof ( IGitExt ) ) ;
3233 }
@@ -210,15 +211,16 @@ static IReadOnlyList<IGitRepositoryInfo> CreateActiveRepositories(params string[
210211 }
211212
212213 static VSGitExt CreateVSGitExt ( IVSUIContext context = null , IGitExt gitExt = null , IAsyncServiceProvider sp = null ,
213- ILocalRepositoryModelFactory repoFactory = null , JoinableTaskContext joinableTaskContext = null )
214+ ILocalRepositoryModelFactory repoFactory = null , JoinableTaskContext joinableTaskContext = null , string contextGuidString = null )
214215 {
215216 context = context ?? CreateVSUIContext ( true ) ;
216217 gitExt = gitExt ?? CreateGitExt ( ) ;
218+ var contextGuid = new Guid ( contextGuidString ?? Guids . GitSccProviderId ) ;
217219 sp = sp ?? Substitute . For < IAsyncServiceProvider > ( ) ;
218220 repoFactory = repoFactory ?? Substitute . For < ILocalRepositoryModelFactory > ( ) ;
219221 joinableTaskContext = joinableTaskContext ?? new JoinableTaskContext ( ) ;
220222 var factory = Substitute . For < IVSUIContextFactory > ( ) ;
221- factory . GetUIContext ( UICONTEXT . RepositoryOpen_guid ) . Returns ( context ) ;
223+ factory . GetUIContext ( contextGuid ) . Returns ( context ) ;
222224 sp . GetServiceAsync ( typeof ( IGitExt ) ) . Returns ( gitExt ) ;
223225 var vsGitExt = new VSGitExt ( sp , factory , repoFactory , joinableTaskContext ) ;
224226 vsGitExt . JoinTillEmpty ( ) ;
0 commit comments