public void Search_Default_LimitedSongs()
        {
            BeatSaverReader reader = new BeatSaverReader()
            {
                StoreRawData = true
            };
            int maxSongs = 10;
            BeatSaverSearchType searchType = BeatSaverSearchType.name;
            string criteria                = "Believer";
            BeatSaverSearchQuery  query    = new SearchQueryBuilder(searchType, criteria).GetQuery();
            BeatSaverFeedSettings settings = new BeatSaverFeedSettings((int)BeatSaverFeedName.Search)
            {
                MaxSongs = maxSongs, SearchQuery = query
            };
            FeedResult result = reader.GetSongsFromFeed(settings);

            Assert.IsTrue(result.Count > 0);
            Assert.IsTrue(result.Count <= 10);
            int expectedPages = ExpectedPagesForSongs(result.Count);

            Assert.AreEqual(expectedPages, result.PagesChecked);
            foreach (ScrapedSong song in result.Songs.Values)
            {
                Console.WriteLine($"{song.Name} by {song.LevelAuthorName}, {song.Hash}");
            }
        }
Ejemplo n.º 2
0
 public BeatSaverSearchQuery(string baseUrl, string query, string criteria, BeatSaverSearchType searchType)
 {
     BaseUrl    = baseUrl;
     Criteria   = criteria;
     Query      = query;
     SearchType = searchType;
 }
 public SearchQueryBuilder(BeatSaverSearchType searchType, string criteria)
 {
     _searchBase     = SearchBases[searchType];
     _searchCriteria = criteria;
 }
Ejemplo n.º 4
0
 public SearchQueryBuilder(BeatSaverSearchType searchType, string criteria)
 {
     SearchType = searchType;
     Criteria   = criteria;
 }