Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public ArtistSearchResult FindArtists(ArtistSearchOptions options)
        {
            var request = createArtistSearchRequest(options);

            return executeRequest<ArtistSearchResult>(request);
        }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
        public void FindArtistsAsync(ArtistSearchOptions options, Action<ArtistSearchResult> callback)
        {
            var request = createArtistSearchRequest(options);

            executeRequestAsync<ArtistSearchResult>(request, callback);
        }