Esempio n. 1
0
        public async Task TestGetNextListing()
        {
            RedditApi api       = new RedditApi();
            Subreddit subreddit = await api.GetSubredditAsync(TestSubredditName);

            Listing listing = await subreddit.GetNewLinksAsync(new ListingRequest { Limit = 1 });

            Listing next = await listing.GetNextListingAsync(1);

            Assert.Equal(1, next.Count);
        }
Esempio n. 2
0
        public async Task TestGetSubredditLinks()
        {
            RedditApi api       = new RedditApi();
            Subreddit subreddit = await api.GetSubredditAsync(TestSubredditName);

            Listing listing = await subreddit.GetNewLinksAsync(new ListingRequest { Limit = 5 });

            var result = listing.ToList();

            foreach (Thing thing in result)
            {
                Assert.IsAssignableFrom(typeof(Link), thing);
            }
        }