Пример #1
0
        public WikiPageRevisionContainer Validate(WikiPageRevisionContainer wikiPageRevisionContainer)
        {
            CheckNull(wikiPageRevisionContainer);
            CheckNull(wikiPageRevisionContainer.Data, "Reddit API returned empty response object.");

            return(wikiPageRevisionContainer);
        }
Пример #2
0
        public void PageRevisions()
        {
            WikiPageRevisionContainer pageRevisions = reddit.Models.Wiki.PageRevisions("index", new SrListingInput(), "ShittyEmails");

            Assert.IsNotNull(pageRevisions);
            Assert.IsTrue(pageRevisions.Data.Children.Count > 0);
        }
Пример #3
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);
        }
Пример #4
0
        public void Revisions()
        {
            WikiPageRevisionContainer revisions = reddit.Models.Wiki.Revisions(new SrListingInput(), "ShittyEmails");

            Assert.IsNotNull(revisions);
        }
Пример #5
0
 public void Validate(WikiPageRevisionContainer wikiPageRevisionContainer)
 {
     Assert.IsNotNull(wikiPageRevisionContainer);
     Assert.IsNotNull(wikiPageRevisionContainer.Data);
 }