diff --git a/src/IF.Lastfm.Core.Tests/Api/LastAuthTests.cs b/src/IF.Lastfm.Core.Tests/Api/LastAuthTests.cs new file mode 100644 index 0000000..4730e17 --- /dev/null +++ b/src/IF.Lastfm.Core.Tests/Api/LastAuthTests.cs @@ -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 + { + {"test", "value"}, + {"test2", "value2"} + }; + + const string expectedHash = "910231882F8AA6D4BBACB7C5FE5F5CC8"; + var actual = _auth.GenerateMethodSignature(method, parameters); + + Assert.AreEqual(expectedHash, actual); + } + } +} \ No newline at end of file diff --git a/src/IF.Lastfm.Core.Tests/IF.Lastfm.Core.Tests.csproj b/src/IF.Lastfm.Core.Tests/IF.Lastfm.Core.Tests.csproj index d0c1160..03a6bdb 100644 --- a/src/IF.Lastfm.Core.Tests/IF.Lastfm.Core.Tests.csproj +++ b/src/IF.Lastfm.Core.Tests/IF.Lastfm.Core.Tests.csproj @@ -84,6 +84,7 @@ +