Пример #1
0
        public void FindSetlists_ByArtistStateAndYear_CanFindSetlists()
        {
            var options = new SetlistSearchOptions() { Year = 2010,
                                                       ArtistName = "Opeth",
                                                       StateCode = "NY" };

            var results = _client.FindSetlists(options);

            Assert.NotNull(results);
            Assert.NotEmpty(results.Setlists);
            Assert.Equal("Opeth", results.Setlists.First().Artist.Name);
            Assert.Equal(new DateTime(2010, 4, 7), results.Setlists.First().EventDate);
        }
Пример #2
0
        private RestRequest createSetlistSearchRequest(SetlistSearchOptions options)
        {
            var request = new RestRequest();
            request.Resource = "search/setlists";

            if (!string.IsNullOrEmpty(options.ArtistMbId))
                request.AddParameter("artistMbid", options.ArtistMbId);

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

            if (!string.IsNullOrEmpty(options.Tour))
                request.AddParameter("tour", options.Tour);

            if (options.Date.HasValue)
                request.AddParameter("date", options.Date.Value.ToString("dd-MM-yyyy"));

            if (options.Year.HasValue)
                request.AddParameter("year", options.Year.Value);

            if (!string.IsNullOrEmpty(options.VenueId))
                request.AddParameter("venueId", options.VenueId);

            if (!string.IsNullOrEmpty(options.VenueName))
                request.AddParameter("venueName", options.VenueName);

            if (!string.IsNullOrEmpty(options.CityId))
                request.AddParameter("cityId", options.CityId);

            if (!string.IsNullOrEmpty(options.CityName))
                request.AddParameter("cityName", options.CityName);

            if (!string.IsNullOrEmpty(options.StateCode))
                request.AddParameter("stateCode", options.StateCode);

            if (!string.IsNullOrEmpty(options.State))
                request.AddParameter("state", options.State);

            if (!string.IsNullOrEmpty(options.CountryCode))
                request.AddParameter("countryCode", options.CountryCode);

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

            return request;
        }
Пример #3
0
        public SetlistSearchResult FindSetlists(SetlistSearchOptions options)
        {
            var request = createSetlistSearchRequest(options);

            return executeRequest<SetlistSearchResult>(request);
        }
Пример #4
0
        public void FindSetlistsAsync(SetlistSearchOptions options, Action<SetlistSearchResult> callback)
        {
            var request = createSetlistSearchRequest(options);

            executeRequestAsync<SetlistSearchResult>(request, callback);
        }