@@ -52,19 +52,21 @@ public async Task DifferentLocalRepository()
5252 vsServices . Received ( 1 ) . ShowMessageBoxInfo ( string . Format ( OpenFromClipboardCommand . DifferentRepositoryMessage , context . RepositoryName ) ) ;
5353 }
5454
55- [ Test ]
56- public async Task CouldNotResolve ( )
55+ [ TestCase ( "TargetOwner" , "CurrentOwner" , OpenFromClipboardCommand . NoResolveDifferentOwnerMessage ) ]
56+ [ TestCase ( "SameOwner" , "SameOwner" , OpenFromClipboardCommand . NoResolveSameOwnerMessage ) ]
57+ [ TestCase ( "sameowner" , "SAMEOWNER" , OpenFromClipboardCommand . NoResolveSameOwnerMessage ) ]
58+ public async Task CouldNotResolve ( string targetOwner , string currentOwner , string expectMessage )
5759 {
58- var context = new GitHubContext ( ) ;
60+ var context = new GitHubContext { Owner = targetOwner } ;
5961 var repositoryDir = "repositoryDir" ;
6062 ( string , string , string ) ? resolveBlobResult = null ;
6163 var vsServices = Substitute . For < IVSServices > ( ) ;
6264 var target = CreateOpenFromClipboardCommand ( vsServices : vsServices ,
63- contextFromClipboard : context , repositoryDir : repositoryDir , resolveBlobResult : resolveBlobResult ) ;
65+ contextFromClipboard : context , repositoryDir : repositoryDir , repositoryOwner : currentOwner , resolveBlobResult : resolveBlobResult ) ;
6466
6567 await target . Execute ( null ) ;
6668
67- vsServices . Received ( 1 ) . ShowMessageBoxInfo ( OpenFromClipboardCommand . NoResolveMessage ) ;
69+ vsServices . Received ( 1 ) . ShowMessageBoxInfo ( expectMessage ) ;
6870 }
6971
7072 [ Test ]
@@ -136,6 +138,7 @@ static OpenFromClipboardCommand CreateOpenFromClipboardCommand(
136138 GitHubContext contextFromClipboard = null ,
137139 string repositoryDir = null ,
138140 string repositoryName = null ,
141+ string repositoryOwner = null ,
139142 string currentBranch = null ,
140143 ( string , string , string ) ? resolveBlobResult = null ,
141144 bool ? hasChanges = null )
@@ -148,6 +151,7 @@ static OpenFromClipboardCommand CreateOpenFromClipboardCommand(
148151 gitHubContextService . FindContextFromClipboard ( ) . Returns ( contextFromClipboard ) ;
149152 teamExplorerContext . ActiveRepository . LocalPath . Returns ( repositoryDir ) ;
150153 teamExplorerContext . ActiveRepository . Name . Returns ( repositoryName ) ;
154+ teamExplorerContext . ActiveRepository . Owner . Returns ( repositoryOwner ) ;
151155 teamExplorerContext . ActiveRepository . CurrentBranch . Name . Returns ( currentBranch ) ;
152156 if ( resolveBlobResult != null )
153157 {
0 commit comments