mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-25 07:26:28 +00:00
35 lines
738 B
C#
35 lines
738 B
C#
|
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()), 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")), Times.Once);
|
||
|
}
|
||
|
}
|
||
|
}
|