mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 07:13:09 +01:00
LastAuth tests
This commit is contained in:
parent
f267ab1735
commit
cc8d6cd2cc
34
src/IF.Lastfm.Core.Tests/Api/LastAuthTests.cs
Normal file
34
src/IF.Lastfm.Core.Tests/Api/LastAuthTests.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using IF.Lastfm.Core.Api;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace IF.Lastfm.Core.Tests.Api
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class LastAuthTests
|
||||||
|
{
|
||||||
|
private ILastAuth _auth;
|
||||||
|
|
||||||
|
[TestInitialize]
|
||||||
|
public void Initialise()
|
||||||
|
{
|
||||||
|
_auth = new LastAuth("user", "pass");
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void GeneratesCorrectMethodSignature()
|
||||||
|
{
|
||||||
|
const string method = "test.method";
|
||||||
|
var parameters = new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{"test", "value"},
|
||||||
|
{"test2", "value2"}
|
||||||
|
};
|
||||||
|
|
||||||
|
const string expectedHash = "910231882F8AA6D4BBACB7C5FE5F5CC8";
|
||||||
|
var actual = _auth.GenerateMethodSignature(method, parameters);
|
||||||
|
|
||||||
|
Assert.AreEqual(expectedHash, actual);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -84,6 +84,7 @@
|
|||||||
<Compile Include="Api\Commands\UserApi\UserGetRecentTracksCommandTests.cs" />
|
<Compile Include="Api\Commands\UserApi\UserGetRecentTracksCommandTests.cs" />
|
||||||
<Compile Include="Api\Commands\UserApi\GetTrackShoutsCommandTests.cs" />
|
<Compile Include="Api\Commands\UserApi\GetTrackShoutsCommandTests.cs" />
|
||||||
<Compile Include="Api\Helpers\ApiHelperTests.cs" />
|
<Compile Include="Api\Helpers\ApiHelperTests.cs" />
|
||||||
|
<Compile Include="Api\LastAuthTests.cs" />
|
||||||
<Compile Include="Api\MockAlbumApi.cs" />
|
<Compile Include="Api\MockAlbumApi.cs" />
|
||||||
<Compile Include="MockLastFm.cs" />
|
<Compile Include="MockLastFm.cs" />
|
||||||
<Compile Include="LastFmTests.cs" />
|
<Compile Include="LastFmTests.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user