Exemplo n.º 1
0
        public async Task GetForumCategoriesAsync_Test()
        {
            var          WebClient    = Setup.SetupWebClient().Result;
            ForumManager forumManager = new ForumManager(WebClient);
            var          forumCatList = await forumManager.GetForumCategoriesAsync();

            Assert.NotNull(forumCatList);
            Assert.True(forumCatList.Any());
        }
Exemplo n.º 2
0
        public async Task GetThreadListAsync_Test()
        {
            var          WebClient    = Setup.SetupWebClient().Result;
            ForumManager forumManager = new ForumManager(WebClient);
            var          forumCatList = await forumManager.GetForumCategoriesAsync();

            Assert.NotNull(forumCatList);
            Assert.True(forumCatList.Any());

            ThreadListManager threadManager = new ThreadListManager(WebClient);
            var result = await threadManager.GetForumThreadListAsync(forumCatList.First().ForumList.First().ForumId, 1);

            Assert.NotNull(result);
            Assert.True(result.Threads.Any());
        }
Exemplo n.º 3
0
        private async Task <List <Category> > LoadForumsFromSite()
        {
            if (_forumManager == null)
            {
                _forumManager = new ForumManager(WebManager);
            }

            try
            {
                var forumResult = await _forumManager.GetForumCategoriesAsync();

                IsLoading = false;
                return(forumResult);
            }
            catch (Exception ex)
            {
                await ResultChecker.SendMessageDialogAsync("Failed to update initial forum list", false);

                IsLoading = false;
                return(new List <Category>());
            }
        }