Exemple #1
0
        public void About()
        {
            SubredditChild about = reddit.Models.Subreddits.About("WayOfTheMueller");
            DynamicShortListingContainer aboutBanned           = reddit.Models.Subreddits.About("banned", new SubredditsAboutInput(), "StillSandersForPres");
            DynamicShortListingContainer aboutMuted            = reddit.Models.Subreddits.About("muted", new SubredditsAboutInput(), "StillSandersForPres");
            DynamicShortListingContainer aboutWikiBanned       = reddit.Models.Subreddits.About("wikibanned", new SubredditsAboutInput(), "StillSandersForPres");
            DynamicShortListingContainer aboutContributors     = reddit.Models.Subreddits.About("contributors", new SubredditsAboutInput(), "StillSandersForPres");
            DynamicShortListingContainer aboutWikiContributors = reddit.Models.Subreddits.About("wikicontributors", new SubredditsAboutInput(), "StillSandersForPres");
            DynamicShortListingContainer aboutModerators       = reddit.Models.Subreddits.About("moderators", new SubredditsAboutInput(), "StillSandersForPres");

            Assert.IsNotNull(about);
            Assert.IsTrue(about.Data.DisplayName.Equals("WayOfTheMueller"));
            Assert.IsNotNull(aboutBanned);
            Assert.IsNotNull(aboutMuted);
            Assert.IsNotNull(aboutWikiBanned);
            Assert.IsNotNull(aboutContributors);
            Assert.IsNotNull(aboutWikiContributors);
            Assert.IsNotNull(aboutModerators);
        }
Exemple #2
0
        public void SiteAdmin()
        {
            // Attempt to create a new subreddit.  --Kris
            GenericContainer res = reddit.Models.Subreddits.SiteAdmin(new SubredditsSiteAdminInput(false, true, true, true, true, true, false, "Test subreddit created by Reddit.NET.",
                                                                                                   false, true, false, "#0000FF", "en-US", "any", testData["Subreddit"], true, false, "Test subreddit created by Reddit.NET.",
                                                                                                   true, true, "low", "high", "high", true, null, "New Bot Link!", "Robots and humans are welcome to post here.  Please adhere to Reddit's rules.",
                                                                                                   "New Bot Post", "new", null, false, "Reddit.NET Bot Testing", "public", "modonly"), null, "Reddit.NET Bot Testing");

            // If sub already exists, attempt an update, instead.  --Kris
            if (res.JSON != null && res.JSON.Errors != null && res.JSON.Errors.Count > 0 &&
                res.JSON.Errors[0][0].Equals("SUBREDDIT_EXISTS"))
            {
                SubredditChild testSub = reddit.Models.Subreddits.About(testData["Subreddit"]);

                res = reddit.Models.Subreddits.SiteAdmin(new SubredditsSiteAdminInput(false, true, true, true, true, true, false, "Test subreddit maintained by Reddit.NET.",
                                                                                      false, true, false, "#0000FF", "en-US", "any", null, true, false, "Test subreddit maintained by Reddit.NET.",
                                                                                      true, true, "low", "high", "high", true, testSub.Data.Name, "New Bot Link!", "Robots and humans are welcome to post here.  Please adhere to Reddit's rules.",
                                                                                      "New Bot Post", "new", null, false, "Reddit.NET Bot Testing", "public", "modonly"), null, "Reddit.NET Bot Testing");
            }

            Validate(res);
        }