2020-06-12 14:01:26 +01:00
|
|
|
using System.Collections.Generic;
|
2022-11-18 11:30:09 +00:00
|
|
|
using System.Threading;
|
2020-06-12 14:01:26 +01:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Moq;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using SpotifyAPI.Web.Http;
|
|
|
|
|
|
|
|
namespace SpotifyAPI.Web.Tests
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
public class FollowClientTest
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public async Task OfCurrentUser_PassesQueryParams()
|
|
|
|
{
|
|
|
|
var api = new Mock<IAPIConnector>();
|
|
|
|
var client = new FollowClient(api.Object);
|
|
|
|
|
|
|
|
var request = new FollowOfCurrentUserRequest(FollowOfCurrentUserRequest.Type.Artist);
|
|
|
|
await client.OfCurrentUser(request);
|
|
|
|
|
|
|
|
api.Verify(a => a.Get<FollowedArtistsResponse>(
|
|
|
|
SpotifyUrls.CurrentUserFollower(),
|
2022-11-18 11:30:09 +00:00
|
|
|
It.Is<Dictionary<string, string>>(val => val.ContainsKey("type")),
|
|
|
|
It.IsAny<CancellationToken>()
|
2020-06-12 14:01:26 +01:00
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|