@@ -230,7 +230,33 @@ public void OwnerRepositoryBranch(string windowTitle, string expectOwner, string
230230 Assert . That ( context . Branch , Is . EqualTo ( expectBranch ) ) ;
231231 }
232232
233- [ TestCase ( "[spike] Open from GitHub URL by jcansdale · Pull Request #1763 · github/VisualStudio - Google Chrome" , 1763 ) ]
233+ [ TestCase ( "github/VisualStudio at build/appveyor-fixes - Google Chrome" , "github" , "VisualStudio" , "build/appveyor-fixes" , Description = "Chrome" ) ]
234+ [ TestCase ( "GitHub - github/VisualStudio at refactor/pr-list - Mozilla Firefox" , "github" , "VisualStudio" , "refactor/pr-list" , Description = "Firefox" ) ]
235+ public void TreeBranch ( string windowTitle , string expectOwner , string expectRepositoryName , string expectBranch )
236+ {
237+ var target = new GitHubContextService ( ) ;
238+
239+ var context = target . FindContextFromWindowTitle ( windowTitle ) ;
240+
241+ Assert . That ( context . Owner , Is . EqualTo ( expectOwner ) ) ;
242+ Assert . That ( context . RepositoryName , Is . EqualTo ( expectRepositoryName ) ) ;
243+ Assert . That ( context . Branch , Is . EqualTo ( expectBranch ) ) ;
244+ }
245+
246+ [ TestCase ( "Branches · github/VisualStudio - Google Chrome" , "github" , "VisualStudio" , Description = "Chrome" ) ]
247+ [ TestCase ( "Branches · github/VisualStudio · GitHub - Mozilla Firefox" , "github" , "VisualStudio" , Description = "Firefox" ) ]
248+ public void Branches ( string windowTitle , string expectOwner , string expectRepositoryName )
249+ {
250+ var target = new GitHubContextService ( ) ;
251+
252+ var context = target . FindContextFromWindowTitle ( windowTitle ) ;
253+
254+ Assert . That ( context . Owner , Is . EqualTo ( expectOwner ) ) ;
255+ Assert . That ( context . RepositoryName , Is . EqualTo ( expectRepositoryName ) ) ;
256+ }
257+
258+ [ TestCase ( "Description · Pull Request #1763 · github/VisualStudio - Google Chrome" , 1763 ) ]
259+ [ TestCase ( "Description · Pull Request #1763 · github/VisualStudio · GitHub - Mozilla Firefox" , 1763 , Description = "Firefox" ) ]
234260 public void PullRequest ( string windowTitle , int expectPullRequest )
235261 {
236262 var target = new GitHubContextService ( ) ;
@@ -241,6 +267,8 @@ public void PullRequest(string windowTitle, int expectPullRequest)
241267 }
242268
243269 [ TestCase ( "Consider adding C# code style preferences to editorconfig · Issue #1750 · github/VisualStudio - Google Chrome" , 1750 ) ]
270+ [ TestCase ( "Scrape browser titles · Issue #4 · jcansdale/VisualStudio · GitHub - Mozilla Firefox" , 4 , Description = "Firefox" ) ]
271+
244272 public void Issue ( string windowTitle , int expectIssue )
245273 {
246274 var target = new GitHubContextService ( ) ;
@@ -252,6 +280,7 @@ public void Issue(string windowTitle, int expectIssue)
252280
253281 [ TestCase ( "VisualStudio/mark_github.xaml at master · github/VisualStudio - Google Chrome" , "mark_github.xaml" ) ]
254282 [ TestCase ( "VisualStudio/src/GitHub.VisualStudio/Resources/icons at master · github/VisualStudio - Google Chrome" , "src/GitHub.VisualStudio/Resources/icons" ) ]
283+ [ TestCase ( "VisualStudio/README.md at master · jcansdale/VisualStudio · GitHub - Mozilla Firefox" , "README.md" , Description = "Firefox" ) ]
255284 public void Path ( string windowTitle , string expectPath )
256285 {
257286 var target = new GitHubContextService ( ) ;
@@ -260,5 +289,17 @@ public void Path(string windowTitle, string expectPath)
260289
261290 Assert . That ( context ? . Path , Is . EqualTo ( expectPath ) ) ;
262291 }
292+
293+ [ TestCase ( "jcansdale/VisualStudio: GitHub Extension for Visual Studio - Google Chrome" , "jcansdale" , "VisualStudio" , Description = "Chrome" ) ]
294+ [ TestCase ( "GitHub - jcansdale/VisualStudio: GitHub Extension for Visual Studio - Mozilla Firefox" , "jcansdale" , "VisualStudio" , Description = "Firefox" ) ]
295+ public void RepositoryHome ( string windowTitle , string expectOwner , string expectRepositoryName )
296+ {
297+ var target = new GitHubContextService ( ) ;
298+
299+ var context = target . FindContextFromWindowTitle ( windowTitle ) ;
300+
301+ Assert . That ( context . Owner , Is . EqualTo ( expectOwner ) ) ;
302+ Assert . That ( context . RepositoryName , Is . EqualTo ( expectRepositoryName ) ) ;
303+ }
263304 }
264305}
0 commit comments