Ejemplo 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);
        }
Ejemplo 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);
            }
        }