Пример #1
0
        public void FindArtists_ByName_CanFindArtist()
        {
            var options = new ArtistSearchOptions { Name = "Opeth" };

            var results = _client.FindArtists(options);

            Assert.Equal("Opeth", results.Artists.First().Name);
        }
Пример #2
0
        public ArtistSearchResult FindArtists(ArtistSearchOptions options)
        {
            var request = createArtistSearchRequest(options);

            return executeRequest<ArtistSearchResult>(request);
        }
Пример #3
0
        private RestRequest createArtistSearchRequest(ArtistSearchOptions options)
        {
            var request = new RestRequest();
            request.Resource = "search/artists";

            if (!string.IsNullOrEmpty(options.Name))
                request.AddParameter("artistName", options.Name);

            if (options.Page.HasValue)
                request.AddParameter("p", options.Page);

            return request;
        }
Пример #4
0
        public void FindArtistsAsync(ArtistSearchOptions options, Action<ArtistSearchResult> callback)
        {
            var request = createArtistSearchRequest(options);

            executeRequestAsync<ArtistSearchResult>(request, callback);
        }