mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 22:56:25 +00:00
0391371a8c
* Bump NUnit from 3.13.3 to 4.0.0 Bumps [NUnit](https://github.com/nunit/nunit) from 3.13.3 to 4.0.0. - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/master/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/v3.13.3...v4.0.0) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * update tests to nunit 4.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Dellinger <jonas@dellinger.dev>
26 lines
662 B
C#
26 lines
662 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.That(request.Object.Headers["Authorization"], Is.EqualTo("Bearer MyToken"));
|
|
}
|
|
}
|
|
}
|