Esempio n. 1
0
        public async Task LoadCommentsPaginationWordPress()
        {
            var dataProvider = new WordPressDataProvider();
            var site         = "en.blog.wordpress.com";
            var postId       = "35160";
            var maxId        = 20;
            await dataProvider.GetComments(site, postId, maxId);

            Assert.IsTrue(dataProvider.HasMoreComments, nameof(dataProvider.HasMoreComments));

            var result = await dataProvider.GetMoreComments();

            Assert.IsFalse(dataProvider.HasMoreComments, nameof(dataProvider.HasMoreComments));

            Assert.IsNotNull(result, $"{nameof(result)} is not null");
            Assert.IsTrue(result.Any());
        }
Esempio n. 2
0
        public async Task LoadMoreCommentsPagination_InvalidOperationWordPress()
        {
            var config = new WordPressDataConfig
            {
                Query = "en.blog.wordpress.com",
                QueryType = WordPressQueryType.Category,
                FilterBy = "themes"
            };

            var dataProvider = new WordPressDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync<InvalidOperationException>(async () => await dataProvider.GetMoreComments());
        }        
Esempio n. 3
0
        public async Task LoadCommentsPaginationWordPress()
        {
            var dataProvider = new WordPressDataProvider();
            var site = "en.blog.wordpress.com";
            var postId = "35160";
            var maxId = 20;
            await dataProvider.GetComments(site, postId, maxId);
            Assert.IsTrue(dataProvider.HasMoreComments, nameof(dataProvider.HasMoreComments));

            var result = await dataProvider.GetMoreComments();
            Assert.IsFalse(dataProvider.HasMoreComments, nameof(dataProvider.HasMoreComments));

            Assert.IsNotNull(result, $"{nameof(result)} is not null");
            Assert.IsTrue(result.Any());
        }
Esempio n. 4
0
        public async Task LoadMoreCommentsPagination_InvalidOperationWordPress()
        {
            var config = new WordPressDataConfig
            {
                Query     = "en.blog.wordpress.com",
                QueryType = WordPressQueryType.Category,
                FilterBy  = "themes"
            };

            var dataProvider = new WordPressDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.GetMoreComments());
        }