Fix GetRecommendationGenres, fixes #487

This commit is contained in:
Jonas Dellinger 2020-07-22 21:51:19 +02:00
parent aed8548c5e
commit d8e9386f62
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Moq;
using NUnit.Framework;
using SpotifyAPI.Web.Http;
namespace SpotifyAPI.Web.Tests
{
[TestFixture]
public class BrowseClientTest
{
[Test]
public async Task GetRecommendationGenres_UsesCorrectURL()
{
var api = new Mock<IAPIConnector>();
var client = new BrowseClient(api.Object);
await client.GetRecommendationGenres();
api.Verify(a => a.Get<RecommendationGenresResponse>(
It.Is<Uri>((uri) => uri.ToString().Contains("recommendations/available-genre-seeds"))
));
}
}
}

View File

@ -60,7 +60,7 @@ namespace SpotifyAPI.Web
public Task<RecommendationGenresResponse> GetRecommendationGenres() public Task<RecommendationGenresResponse> GetRecommendationGenres()
{ {
return API.Get<RecommendationGenresResponse>(URLs.Recommendations()); return API.Get<RecommendationGenresResponse>(URLs.RecommendationGenres());
} }
public Task<NewReleasesResponse> GetNewReleases() public Task<NewReleasesResponse> GetNewReleases()