@@ -57,6 +57,8 @@ public async Task Filter(string filter, string owner, string name, string url, i
5757 [ TestCase ( "filter" , null ) ]
5858 [ TestCase ( "https://github.com" , null ) ]
5959 [ TestCase ( "https://github.com/github/VisualStudio" , "https://github.com/github/VisualStudio" ) ]
60+ [ TestCase ( "https://github.com/github/VisualStudio/blob/master/README.md" , "https://github.com/github/VisualStudio/blob/master/README.md" ) ]
61+ [ TestCase ( "https://github.com/github/VisualStudio/pull/2208" , null ) ]
6062 public void Set_Repository_When_Filter_Is_Url ( string url , string expectUrl )
6163 {
6264 var expectCloneUrl = expectUrl != null ? new UriString ( expectUrl ) : null ;
@@ -69,6 +71,24 @@ public void Set_Repository_When_Filter_Is_Url(string url, string expectUrl)
6971
7072 Assert . That ( target . Repository ? . CloneUrl , Is . EqualTo ( expectCloneUrl ) ) ;
7173 }
74+
75+ [ TestCase ( "filter;https://github.com/github/VisualStudio" , "https://github.com/github/VisualStudio" ) ]
76+ [ TestCase ( "https://github.com/github/VisualStudio;filter" , null ) ]
77+ public void Change_Filters ( string filters , string expectUrl )
78+ {
79+ var expectCloneUrl = expectUrl != null ? new UriString ( expectUrl ) : null ;
80+ var repositoryCloneService = CreateRepositoryCloneService ( ) ;
81+ var gitHubContextService = new GitHubContextService ( Substitute . For < IGitHubServiceProvider > ( ) ,
82+ Substitute . For < IGitService > ( ) , Substitute . For < IVSServices > ( ) ) ;
83+ var target = new RepositorySelectViewModel ( repositoryCloneService , gitHubContextService ) ;
84+
85+ foreach ( var filter in filters . Split ( ';' ) )
86+ {
87+ target . Filter = filter ;
88+ }
89+
90+ Assert . That ( target . Repository ? . CloneUrl , Is . EqualTo ( expectCloneUrl ) ) ;
91+ }
7292 }
7393
7494 static IGitHubContextService CreateGitHubContextService ( )
0 commit comments