Exemplo n.º 1
0
        public void GetAuthorizationUrl_must_return_url_without_scope_when_called_without_scope_()
        {
            var target = new APIAuthorizer("client", "key", new Uri("https://www.mystore.com/manager"));

            Assert.AreEqual("https://www.mystore.com/manager/oauth/authorization.aspx?client_id=client", target.GetAuthorizationUrl(null));
        }
Exemplo n.º 2
0
        public void GetAuthorizationUrl_must_return_url_with_scope_when_called_with_valid_scope()
        {
            var target = new APIAuthorizer("client", "key", new Uri("https://www.mystore.com/manager"));

            Assert.AreEqual("https://www.mystore.com/manager/oauth/authorization.aspx?client_id=client&scope=readDepartment,writeOrder",
                target.GetAuthorizationUrl(new string[] { "readDepartment", "writeOrder" }));
        }
Exemplo n.º 3
0
        public void GetAuthorizationUrl_must_return_url_without_additional_slash_when_storeurl_ends_with_slash()
        {
            var target = new APIAuthorizer("client", "key", new Uri("https://www.mystore.com/manager/"));

            Assert.AreEqual("https://www.mystore.com/manager/oauth/authorization.aspx?client_id=client", target.GetAuthorizationUrl(null));
        }