mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 14:46:26 +00:00
b8a2190168
* 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>
36 lines
822 B
C#
36 lines
822 B
C#
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Moq;
|
|
using NUnit.Framework;
|
|
using SpotifyAPI.Web.Http;
|
|
|
|
namespace SpotifyAPI.Web
|
|
{
|
|
[TestFixture]
|
|
public class UserProfileClientTest
|
|
{
|
|
[Test]
|
|
public async Task Current()
|
|
{
|
|
var api = new Mock<IAPIConnector>();
|
|
var client = new UserProfileClient(api.Object);
|
|
|
|
await client.Current();
|
|
|
|
api.Verify(a => a.Get<PrivateUser>(SpotifyUrls.Me(), It.IsAny<CancellationToken>()), Times.Once);
|
|
}
|
|
|
|
[Test]
|
|
public async Task Get()
|
|
{
|
|
var userId = "johnnycrazy";
|
|
var api = new Mock<IAPIConnector>();
|
|
var client = new UserProfileClient(api.Object);
|
|
|
|
await client.Get(userId);
|
|
|
|
api.Verify(a => a.Get<PublicUser>(SpotifyUrls.User(userId), It.IsAny<CancellationToken>()), Times.Once);
|
|
}
|
|
}
|
|
}
|