Skip to content

Commit

Permalink
Merge pull request NuGet#2204 from NuGet/danliu/tests
Browse files Browse the repository at this point in the history
add about gallery page test
  • Loading branch information
danliu committed Jun 9, 2014
2 parents 9f64785 + 72d34f0 commit e4e3428
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tests/NuGetGallery.FunctionalTests.Helpers/UrlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ public static string ManageMyPackagesUrl
get { return UrlHelper.BaseUrl + ManageMyPackagesUrlSuffix; }
}

public static string AboutGalleryPageUrl
{
get { return UrlHelper.BaseUrl + AboutPageUrlSuffix; }
}

public static string GetPackagePageUrl(string packageId)
{
return UrlHelper.BaseUrl + @"Packages/" + packageId;
Expand Down Expand Up @@ -185,6 +190,7 @@ public static string GetContactOwnerPageUrl(string packageId)
private const string AccountUnscribeUrlSuffix = "account/unsubscribe";
private const string AccountApiKeyResetUrlSuffix = "/account/GenerateApiKey";
private const string ManageMyPackagesUrlSuffix = "/account/Packages";
private const string AboutPageUrlSuffix = "policies/About";
#endregion UrlSuffix
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,20 @@ public void TestStatisticsPageLinks()
TestLinksOnWebPagesUsingFluentLinkChecker(UrlHelper.StatsPageUrl);
}

[TestMethod]
[Description("Test all clickable links on the About Gallery page are returning 200")]
[Priority(1)]
public void TestAboutGalleryPageLinks()
{
TestLinksOnWebPagesUsingFluentLinkChecker(UrlHelper.AboutGalleryPageUrl);
}

#region Helper Methods
public bool TestLinksOnWebPagesUsingFluentLinkChecker(string uri)
public bool TestLinksOnWebPagesUsingFluentLinkChecker(string url)
{
Console.WriteLine("Starting Url is: {0}", url);
var result = LinkCheck
.On(src => src.Url(new Uri(uri))
.On(src => src.Url(new Uri(url))
.Relative())
.AsBot(bot => bot.Bing())
.Start();
Expand Down

0 comments on commit e4e3428

Please sign in to comment.