Spotify.NET/SpotifyAPI.Web.Tests/Clients/BrowseClientTest.cs
Sascha Kiefer b8a2190168
feat: allow to pass cancellation token to requests (#813)
* feat: implements markets API

* fix: use correct constructor name

* feat: allow to pass a cancellation token

* pass cancellation token

* pass cancellation token only >NETSTANDARD2_1

Co-authored-by: Jonas Dellinger <jonas@dellinger.dev>
2022-11-18 12:30:09 +01:00

29 lines
683 B
C#

using System;
using System.Collections.Generic;
using System.Threading;
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")),
It.IsAny<CancellationToken>()
));
}
}
}