Example #1
0
        public virtual void Initialise()
        {
            var testApiKey      = "59dd1140db864fd4a68ca820709eaf98";
            var testApiSecret   = "fa45357dcd914671a22def63cbe79a46";
            var testUserSession = new LastUserSession
            {
                IsSubscriber = false,
                Token        = "071a119a9aac4942b1b05328a5591f55",
                Username     = "******"
            };

            MockAuth = new Mock <ILastAuth>();
            MockAuth.SetupGet(m => m.Authenticated).Returns(true);
            MockAuth.SetupGet(m => m.ApiKey).Returns(testApiKey);

            var stubAuth = new LastAuth(testApiKey, testApiSecret);

            stubAuth.LoadSession(testUserSession);
            MockAuth.Setup(m => m.GenerateMethodSignature(It.IsAny <string>(), It.IsAny <Dictionary <string, string> >()))
            .Returns <string, Dictionary <string, string> >((method, parameters) => stubAuth.GenerateMethodSignature(method, parameters));

            FakeResponseHandler = new QueueFakeResponseHandler();
            Scrobbler           = GetScrobbler();
        }
Example #2
0
        public virtual void Initialise()
        {
            var testApiKey = "59dd1140db864fd4a68ca820709eaf98";
            var testApiSecret = "fa45357dcd914671a22def63cbe79a46";
            var testUserSession = new LastUserSession
            {
                IsSubscriber = false,
                Token = "071a119a9aac4942b1b05328a5591f55",
                Username = "******"
            };

            MockAuth = new Mock<ILastAuth>();
            MockAuth.SetupGet(m => m.Authenticated).Returns(true);
            MockAuth.SetupGet(m => m.ApiKey).Returns(testApiKey);

            var stubAuth = new LastAuth(testApiKey, testApiSecret);
            stubAuth.LoadSession(testUserSession);
            MockAuth.Setup(m => m.GenerateMethodSignature(It.IsAny<string>(), It.IsAny<Dictionary<string, string>>()))
                .Returns<string, Dictionary<string, string>>((method, parameters) => stubAuth.GenerateMethodSignature(method, parameters));

            FakeResponseHandler = new QueueFakeResponseHandler();
            Scrobbler = GetScrobbler();
        }