Пример #1
0
        private async void MoreItemsRequest()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();

                var items = await twitterDataProvider.LoadMoreDataAsync();

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }

                var rawData = await rawDataProvider.LoadMoreDataAsync <RawSchema>();

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Пример #2
0
        private async void GetMoreItems()
        {
            var items = await _twitterDataProvider.LoadMoreDataAsync();

            foreach (var item in items)
            {
                Items.Add(item);
            }
        }
        public async Task LoadPaginationTwitterHomeTimeLine()
        {
            var config = new TwitterDataConfig
            {
                QueryType = TwitterQueryType.Home
            };
            var dataProvider = new TwitterDataProvider(OAuthKeys.TwitterValidKeys);
            await dataProvider.LoadDataAsync(config, 2);

            Assert.IsTrue(dataProvider.HasMoreItems);

            IEnumerable <TwitterSchema> result = await dataProvider.LoadMoreDataAsync();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any());
        }
        public async Task LoadPaginationTwitterSearch()
        {
            var config = new TwitterDataConfig
            {
                QueryType = TwitterQueryType.Search,
                Query     = "microsoft"
            };
            var dataProvider = new TwitterDataProvider(OAuthKeys.TwitterValidKeys);
            await dataProvider.LoadDataAsync(config, 2);

            Assert.IsTrue(dataProvider.HasMoreItems, "HasMoreItems is false");

            IEnumerable <TwitterSchema> result = await dataProvider.LoadMoreDataAsync();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any(), "There aren't any elements");
        }
 public async Task LoadMoreDataInvalidOperationTwitterSearch()
 {
     var config = new TwitterDataConfig
     {
         QueryType = TwitterQueryType.Search,
         Query     = "lumia"
     };
     var dataProvider = new TwitterDataProvider(OAuthKeys.TwitterValidKeys);
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
 }
Пример #6
0
 public async Task LoadMoreDataInvalidOperationTwitterSearch()
 {
     var config = new TwitterDataConfig
     {
         QueryType = TwitterQueryType.Search,
         Query = "lumia"
     };
     var dataProvider = new TwitterDataProvider(OAuthKeys.TwitterValidKeys);
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync<InvalidOperationException>(async () => await dataProvider.LoadMoreDataAsync());
 }
Пример #7
0
        public async Task LoadPaginationTwitterSearch()
        {

            var config = new TwitterDataConfig
            {
                QueryType = TwitterQueryType.Search,
                Query = "microsoft"
            };
            var dataProvider = new TwitterDataProvider(OAuthKeys.TwitterValidKeys);
            await dataProvider.LoadDataAsync(config, 2);

            Assert.IsTrue(dataProvider.HasMoreItems, "HasMoreItems is false");

            IEnumerable <TwitterSchema> result = await dataProvider.LoadMoreDataAsync();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any(), "There aren't any elements");
        }
Пример #8
0
        public async Task LoadPaginationTwitterUserTimeLine()
        {

            var config = new TwitterDataConfig
            {
                QueryType = TwitterQueryType.User,
                Query = "lumia"
            };
            var dataProvider = new TwitterDataProvider(OAuthKeys.TwitterValidKeys);
            await dataProvider.LoadDataAsync(config, 5);

            Assert.IsTrue(dataProvider.HasMoreItems);

            IEnumerable<TwitterSchema> result = await dataProvider.LoadMoreDataAsync();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any());
        }
Пример #9
0
 public override async Task <IEnumerable <TwitterSchema> > GetNextPageAsync()
 {
     return(await _dataProvider.LoadMoreDataAsync());
 }