mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 15:06:26 +00:00
25 lines
653 B
C#
25 lines
653 B
C#
using System.Collections.Generic;
|
|
using Moq;
|
|
using NUnit.Framework;
|
|
using SpotifyAPI.Web.Http;
|
|
|
|
namespace SpotifyAPI.Web.Tests
|
|
{
|
|
[TestFixture]
|
|
public class TokenAuthenticatorTest
|
|
{
|
|
[Test]
|
|
public void Apply_AddsCorrectHeader()
|
|
{
|
|
var authenticator = new TokenAuthenticator("MyToken", "Bearer");
|
|
var request = new Mock<IRequest>();
|
|
var apiConnector = new Mock<IAPIConnector>();
|
|
|
|
request.SetupGet(r => r.Headers).Returns(new Dictionary<string, string>());
|
|
|
|
authenticator.Apply(request.Object, apiConnector.Object);
|
|
Assert.AreEqual(request.Object.Headers["Authorization"], "Bearer MyToken");
|
|
}
|
|
}
|
|
}
|