@@ -19,14 +19,15 @@ public class VSGitExtTests
19
19
{
20
20
public class TheConstructor : TestBaseClass
21
21
{
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 )
25
26
{
26
27
var context = CreateVSUIContext ( isActive ) ;
27
28
var sp = Substitute . For < IAsyncServiceProvider > ( ) ;
28
29
29
- var target = CreateVSGitExt ( context , sp : sp ) ;
30
+ var target = CreateVSGitExt ( context , sp : sp , contextGuidString : contextGuidString ) ;
30
31
31
32
sp . Received ( expectCalls ) . GetServiceAsync ( typeof ( IGitExt ) ) ;
32
33
}
@@ -210,15 +211,16 @@ static IReadOnlyList<IGitRepositoryInfo> CreateActiveRepositories(params string[
210
211
}
211
212
212
213
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 )
214
215
{
215
216
context = context ?? CreateVSUIContext ( true ) ;
216
217
gitExt = gitExt ?? CreateGitExt ( ) ;
218
+ var contextGuid = new Guid ( contextGuidString ?? Guids . GitSccProviderId ) ;
217
219
sp = sp ?? Substitute . For < IAsyncServiceProvider > ( ) ;
218
220
repoFactory = repoFactory ?? Substitute . For < ILocalRepositoryModelFactory > ( ) ;
219
221
joinableTaskContext = joinableTaskContext ?? new JoinableTaskContext ( ) ;
220
222
var factory = Substitute . For < IVSUIContextFactory > ( ) ;
221
- factory . GetUIContext ( UICONTEXT . RepositoryOpen_guid ) . Returns ( context ) ;
223
+ factory . GetUIContext ( contextGuid ) . Returns ( context ) ;
222
224
sp . GetServiceAsync ( typeof ( IGitExt ) ) . Returns ( gitExt ) ;
223
225
var vsGitExt = new VSGitExt ( sp , factory , repoFactory , joinableTaskContext ) ;
224
226
vsGitExt . JoinTillEmpty ( ) ;
0 commit comments