public WikiPageRevisionContainer Validate(WikiPageRevisionContainer wikiPageRevisionContainer) { CheckNull(wikiPageRevisionContainer); CheckNull(wikiPageRevisionContainer.Data, "Reddit API returned empty response object."); return(wikiPageRevisionContainer); }
public void PageRevisions() { WikiPageRevisionContainer pageRevisions = reddit.Models.Wiki.PageRevisions("index", new SrListingInput(), "ShittyEmails"); Assert.IsNotNull(pageRevisions); Assert.IsTrue(pageRevisions.Data.Children.Count > 0); }
public void ModifyPage() { // Ordered by most recent first. --Kris WikiPageRevisionContainer revisions = reddit.Models.Wiki.PageRevisions("index", new SrListingInput(), testData["Subreddit"]); Validate(revisions); Assert.IsTrue(revisions.Data.Children != null && revisions.Data.Children.Count > 0); // Edit an existing page. --Kris reddit.Models.Wiki.Edit(new WikiEditPageInput("There are only 10 types of people in this world: Those who understand binary and those who don't.", "index", "Because I said so.", revisions.Data.Children[0].Id), testData["Subreddit"]); // Hide the page. --Kris StatusResult hideRes = reddit.Models.Wiki.Hide(new WikiPageRevisionInput("index", revisions.Data.Children[0].Id), testData["Subreddit"]); // Unhide the page. --Kris StatusResult unhideRes = reddit.Models.Wiki.Hide(new WikiPageRevisionInput("index", revisions.Data.Children[0].Id), testData["Subreddit"]); Validate(hideRes); Validate(unhideRes); // Revert to the original page version. --Kris reddit.Models.Wiki.Revert(new WikiPageRevisionInput("index", revisions.Data.Children[revisions.Data.Children.Count - 1].Id), testData["Subreddit"]); // Update the permissions. --Kris WikiPageSettingsContainer res = reddit.Models.Wiki.UpdatePermissions("index", new WikiUpdatePermissionsInput(), testData["Subreddit"]); Validate(res); }
public void Revisions() { WikiPageRevisionContainer revisions = reddit.Models.Wiki.Revisions(new SrListingInput(), "ShittyEmails"); Assert.IsNotNull(revisions); }
public void Validate(WikiPageRevisionContainer wikiPageRevisionContainer) { Assert.IsNotNull(wikiPageRevisionContainer); Assert.IsNotNull(wikiPageRevisionContainer.Data); }