Exemplo n.º 1
0
        private async void LoadArticleRegion()
        {
            if (IsArticleLoading)
            {
                return;
            }

            IsArticleLoading = true;
            try
            {
                var articleRegionResult = await _aiXiFanService.GetRegionAsync(11, 63);

                if (articleRegionResult.Code == HttpStatusCode.OK)
                {
                    Article = articleRegionResult.Data;
                }
                else
                {
                    // TODO
                }
            }
            catch (HttpRequestException)
            {
                // TODO
                await new MessageDialog("加载文章失败").ShowAsync();
            }
            finally
            {
                IsArticleLoading = false;
            }
        }
Exemplo n.º 2
0
        public async Task TestGetRegionAsync()
        {
            var result = await _aiXiFanService.GetRegionAsync(0, null);

            Assert.AreEqual(result.Code, 200);
        }