Ejemplo n.º 1
0
 public async Task TestInvalidOperationLoadChannel()
 {
     var channel      = @"elrubiusOMG";
     var pageSize     = 1;
     var dataProvider = new YouTubeDataProvider(OAuthKeys.YouTubeValidKeys);
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreChannelAsync(channel, pageSize));
 }
Ejemplo n.º 2
0
        public async Task TestValidateConfig_GetApiDataAsync()
        {
            var config       = new RestApiDataConfig();
            var dataProvider = new RestApiDataProvider();
            ConfigParameterNullException exception = await ExceptionsAssert.ThrowsAsync <ConfigParameterNullException>(async() => await dataProvider.GetApiDataAsync(config, 20, new WordPress.WordPressParser()));

            Assert.IsTrue(exception.Message.Contains(nameof(RestApiDataConfig.Url)));
        }
Ejemplo n.º 3
0
 public async Task LoadMoreDataInvalidOperationFacebook()
 {
     var config = new FacebookDataConfig
     {
         UserId = "8195378771",
     };
     var dataProvider = new FacebookDataProvider(OAuthKeys.FacebookValidKeys);
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
 }
Ejemplo n.º 4
0
 public async Task TestGetMoreApiDataAsyncInvalidOperation()
 {
     var config = new RestApiDataConfig
     {
         Url = new Uri(@"https://public-api.wordpress.com/rest/v1.1/sites/en.blog.wordpress.com/posts/")
     };
     var dataProvider = new RestApiDataProvider();
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.GetMoreApiDataAsync <WordPress.WordPressSchema>());
 }
Ejemplo n.º 5
0
 public async Task TestNullParser_GetApiDataAsync()
 {
     var config = new RestApiDataConfig
     {
         Url = new Uri(@"https://public-api.wordpress.com/rest/v1.1/sites/en.blog.wordpress.com/posts/")
     };
     var dataProvider = new RestApiDataProvider();
     ParserNullException exception = await ExceptionsAssert.ThrowsAsync <ParserNullException>(async() => await dataProvider.GetApiDataAsync <WordPress.WordPressSchema>(config, 20, null));
 }
 public async Task LoadMoreDataInvalidOperationTwitterHomeTimeLine()
 {
     var config = new TwitterDataConfig
     {
         QueryType = TwitterQueryType.Home
     };
     var dataProvider = new TwitterDataProvider(OAuthKeys.TwitterValidKeys);
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
 }
Ejemplo n.º 7
0
 public async Task LoadMoreDataInvalidOperationPlaylist()
 {
     var config = new YouTubeDataConfig
     {
         QueryType = YouTubeQueryType.Playlist,
         Query     = @"PLB9EA94DACBEC74A9"
     };
     var dataProvider = new YouTubeDataProvider(OAuthKeys.YouTubeValidKeys);
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
 }
Ejemplo n.º 8
0
        public async Task LoadMoreDataInvalidOperationStaticCollection()
        {
            var config = new LocalStorageDataConfig
            {
                FilePath = "/Assets/LocalCollectionData.json"
            };

            var dataProvider = new LocalStorageDataProvider <CollectionSchema>();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
        }
Ejemplo n.º 9
0
        public async Task LoadMoreDataInvalidOperationRss()
        {
            var config = new RssDataConfig()
            {
                Url = new Uri("http://blogs.msdn.com/b/windows_app_studio_news/rss.aspx")
            };

            var dataProvider = new RssDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
        }
Ejemplo n.º 10
0
 public async Task LoadInstagramInvalidUserId()
 {
     var config = new InstagramDataConfig
     {
         QueryType = InstagramQueryType.Id,
         Query     = "-1234"
     };
     var dataProvider = new InstagramDataProvider(OAuthKeys.InstagramValidKeys);
     await ExceptionsAssert.ThrowsAsync <RequestFailedException>(async() => await dataProvider.LoadDataAsync(config));
 }
Ejemplo n.º 11
0
 public async Task LoadMoreDataInvalidOperationChannel()
 {
     var config = new YouTubeDataConfig
     {
         QueryType = YouTubeQueryType.Channels,
         Query     = @"elrubiusOMG"
     };
     var dataProvider = new YouTubeDataProvider(OAuthKeys.YouTubeValidKeys);
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
 }
Ejemplo n.º 12
0
 public async Task LoadMoreDataInvalidOperationVideos()
 {
     var config = new YouTubeDataConfig
     {
         QueryType = YouTubeQueryType.Videos,
         Query     = @"windows app studio"
     };
     var dataProvider = new YouTubeDataProvider(OAuthKeys.YouTubeValidKeys);
     InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
 }
Ejemplo n.º 13
0
        public async Task TestNullOAuth()
        {
            YouTubeDataConfig config = new YouTubeDataConfig
            {
                QueryType = YouTubeQueryType.Videos,
                Query     = @"lumia"
            };
            YouTubeDataProvider dataProvider = new YouTubeDataProvider(null);

            await ExceptionsAssert.ThrowsAsync <ConfigParameterNullException>(async() => await dataProvider.LoadDataAsync(config));
        }
Ejemplo n.º 14
0
        public async Task LoadMoreDataInvalidOperationFlickrUser()
        {
            var config = new FlickrDataConfig
            {
                Query     = "100292344@N05",
                QueryType = FlickrQueryType.Id
            };

            var dataProvider = new FlickrDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
        }
Ejemplo n.º 15
0
        public async Task LoadMoreDataInvalidOperationFlickrTags()
        {
            var config = new FlickrDataConfig
            {
                Query     = "windowsappstudio",
                QueryType = FlickrQueryType.Tags
            };

            var dataProvider = new FlickrDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
        }
Ejemplo n.º 16
0
        public async Task LoadMoreDataInvalidOperationBing()
        {
            var config = new BingDataConfig
            {
                Query   = "Windows App Studio",
                Country = BingCountry.UnitedStates
            };

            var dataProvider = new BingDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
        }
Ejemplo n.º 17
0
        public async Task LoadMoreDataBeforeLoadDataWordPressPost()
        {
            var config = new WordPressDataConfig
            {
                Query     = "en.blog.wordpress.com",
                QueryType = WordPressQueryType.Posts
            };

            var dataProvider = new WordPressDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
        }
        public async Task TestNullOAuth()
        {
            var config = new TwitterDataConfig
            {
                QueryType = TwitterQueryType.User,
                Query     = "lumia"
            };
            var dataProvider = new TwitterDataProvider(null);

            await ExceptionsAssert.ThrowsAsync <ConfigParameterNullException>(async() => await dataProvider.LoadDataAsync(config));
        }
Ejemplo n.º 19
0
        public async Task TestNullOAuth()
        {
            var config = new FacebookDataConfig
            {
                UserId = "8195378771",
            };

            var dataProvider = new FacebookDataProvider(null);

            await ExceptionsAssert.ThrowsAsync <ConfigParameterNullException>(async() => await dataProvider.LoadDataAsync(config));
        }
Ejemplo n.º 20
0
        public async Task TestRevokedOAuth()
        {
            var config = new FacebookDataConfig
            {
                UserId = "8195378771",
            };

            var dataProvider = new FacebookDataProvider(OAuthKeys.FacebookRevokedKeys);

            await ExceptionsAssert.ThrowsAsync <OAuthKeysRevokedException>(async() => await dataProvider.LoadDataAsync(config));
        }
Ejemplo n.º 21
0
        public async Task TestRevokedOAuth()
        {
            var config = new InstagramDataConfig
            {
                QueryType = InstagramQueryType.Tag,
                Query     = "windowsappstudio"
            };

            var dataProvider = new InstagramDataProvider(OAuthKeys.InstagramRevokedKeys);

            await ExceptionsAssert.ThrowsAsync <OAuthKeysRevokedException>(async() => await dataProvider.LoadDataAsync(config));
        }
Ejemplo n.º 22
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());
        }
Ejemplo n.º 23
0
        public async Task TestNullOAuth()
        {
            var config = new InstagramDataConfig
            {
                QueryType = InstagramQueryType.Tag,
                Query     = "windowsappstudio"
            };

            var dataProvider = new InstagramDataProvider(null);

            await ExceptionsAssert.ThrowsAsync <ConfigParameterNullException>(async() => await dataProvider.LoadDataAsync(config));
        }
        public async Task TestRevokedOAuth()
        {
            var config = new TwitterDataConfig
            {
                QueryType = TwitterQueryType.User,
                Query     = "lumia"
            };

            var dataProvider = new TwitterDataProvider(OAuthKeys.TwitterRevokedKeys);

            await ExceptionsAssert.ThrowsAsync <OAuthKeysRevokedException>(async() => await dataProvider.LoadDataAsync(config));
        }
Ejemplo n.º 25
0
        public async Task LoadMoreDataInvalidOperation()
        {
            var pagination = new TokenPagination("page_handle", "next_page", string.Empty);
            var config     = new RestApiDataConfig
            {
                Url = new Uri(@"https://public-api.wordpress.com/rest/v1.1/sites/en.blog.wordpress.com/posts/"),
                PaginationConfig = pagination
            };

            var dataProvider = new RestApiDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync <WordPress.WordPressSchema>());
        }
        public async Task TestNullQuery()
        {
            var config = new TwitterDataConfig
            {
                QueryType = TwitterQueryType.User
            };
            var dataProvider = new TwitterDataProvider(new TwitterOAuthTokens());

            ConfigParameterNullException exception = await ExceptionsAssert.ThrowsAsync <ConfigParameterNullException>(async() => await dataProvider.LoadDataAsync(config));

            Assert.IsTrue(exception.Message.Contains("Query"));
        }
Ejemplo n.º 27
0
        public async Task TestRevokedOAuth()
        {
            var config = new YouTubeDataConfig
            {
                QueryType = YouTubeQueryType.Videos,
                Query     = @"lumia"
            };

            var dataProvider = new YouTubeDataProvider(OAuthKeys.YouTubeRevokedKeys);

            await ExceptionsAssert.ThrowsAsync <RequestFailedException>(async() => await dataProvider.LoadDataAsync(config));
        }
Ejemplo n.º 28
0
        public async Task LoadMoreDataInvalidOperationWordPressTag()
        {
            var config = new WordPressDataConfig
            {
                Query     = "en.blog.wordpress.com",
                QueryType = WordPressQueryType.Tag,
                FilterBy  = "apps"
            };

            var dataProvider = new WordPressDataProvider();
            InvalidOperationException exception = await ExceptionsAssert.ThrowsAsync <InvalidOperationException>(async() => await dataProvider.LoadMoreDataAsync());
        }
Ejemplo n.º 29
0
        public async Task TestNullUrlConfig()
        {
            var config = new RssDataConfig
            {
                Url = null
            };

            var dataProvider = new RssDataProvider();

            ConfigParameterNullException exception = await ExceptionsAssert.ThrowsAsync <ConfigParameterNullException>(async() => await dataProvider.LoadDataAsync(config));

            Assert.IsTrue(exception.Message.Contains("Url"));
        }
        public async Task TestEmptyOAuth()
        {
            var config = new TwitterDataConfig
            {
                QueryType = TwitterQueryType.User,
                Query     = "lumia"
            };
            var dataProvider = new TwitterDataProvider(new TwitterOAuthTokens());

            OAuthKeysNotPresentException exception = await ExceptionsAssert.ThrowsAsync <OAuthKeysNotPresentException>(async() => await dataProvider.LoadDataAsync(config));

            Assert.IsTrue(exception.Message.Contains("ConsumerKey"));
        }