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