예제 #1
0
        public void BeatSaverFavoriteMappers_Cancelled()
        {
            var config       = DefaultConfig;
            var sourceConfig = DefaultConfig.BeatSaver;

            sourceConfig.MaxConcurrentPageChecks = 5;
            var feedConfig = sourceConfig.FavoriteMappers;

            feedConfig.MaxSongs = 60;
            var songDownloader = new SongDownloader(config, null, null, SONGSPATH);
            var reader         = new BeatSaverReader();
            var settings       = (BeatSaverFeedSettings)feedConfig.ToFeedSettings();
            var queryBuilder   = new SearchQueryBuilder(BeatSaverSearchType.author, "Ruckus");

            settings.SearchQuery = queryBuilder.GetQuery();
            CancellationTokenSource cts = new CancellationTokenSource(150);
            var resultTask = songDownloader.ReadFeed(reader, settings, 0, null, PlaylistStyle.Append, cts.Token);


            var result = resultTask.Result;

            Assert.IsNotNull(result);
            Assert.IsFalse(result.Successful);
            Assert.AreEqual(FeedResultError.Cancelled, result.ErrorCode);
        }
예제 #2
0
        public void BeatSaverHot()
        {
            var config       = DefaultConfig;
            var sourceConfig = DefaultConfig.BeatSaver;

            sourceConfig.MaxConcurrentPageChecks = 5;
            var feedConfig = sourceConfig.Hot;

            feedConfig.MaxSongs = 60;
            var songDownloader = new SongDownloader(config, null, null, SONGSPATH);
            var reader         = new BeatSaverReader();
            var settings       = feedConfig.ToFeedSettings();

            CancellationTokenSource cts = new CancellationTokenSource();
            var resultTask = songDownloader.ReadFeed(reader, settings, 0, null, PlaylistStyle.Append, cts.Token);


            var result = resultTask.Result;

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count > 0);
        }
예제 #3
0
        public void BeatSaverHot_Cancelled()
        {
            var config       = DefaultConfig;
            var sourceConfig = DefaultConfig.BeatSaver;

            sourceConfig.MaxConcurrentPageChecks = 5;
            var feedConfig = sourceConfig.Hot;

            feedConfig.MaxSongs = 60;
            var songDownloader = new SongDownloader(config, null, null, SONGSPATH);
            var reader         = new BeatSaverReader();
            var settings       = feedConfig.ToFeedSettings();

            CancellationTokenSource cts = new CancellationTokenSource(150);
            var resultTask = songDownloader.ReadFeed(reader, settings, 0, null, PlaylistStyle.Append, cts.Token);


            var result = resultTask.Result;

            Assert.IsNotNull(result);
            Assert.IsFalse(result.Successful);
            Assert.AreEqual(FeedResultError.Cancelled, result.ErrorCode);
        }
예제 #4
0
        public void BeastSaberBookmarks()
        {
            CancellationTokenSource cts = new CancellationTokenSource();
            var config       = DefaultConfig;
            var sourceConfig = DefaultConfig.BeastSaber;

            sourceConfig.MaxConcurrentPageChecks = 5;
            var feedConfig = sourceConfig.Bookmarks;

            feedConfig.MaxSongs = 60;
            var songDownloader = new SongDownloader(config, null, null, SONGSPATH);
            var reader         = new BeastSaberReader(sourceConfig.Username, sourceConfig.MaxConcurrentPageChecks);
            var settings       = feedConfig.ToFeedSettings();

            var result = songDownloader.ReadFeed(reader, settings, 0, null, PlaylistStyle.Append, cts.Token).Result;

            if (!result.Successful)
            {
                Console.WriteLine(result.FaultedResults.First().Exception);
            }
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count > 0);
        }