예제 #1
0
        public void CountOfParametersEquals0()
        {
            string path       = string.Empty;
            var    parameters = new Dictionary <string, object>();

            FacebookUtils.ParseQueryParametersToDictionary(path, parameters);

            Assert.Equal(0, parameters.Count);
        }
예제 #2
0
        public void TheCountOfParameterIsEqualToTheCountOfQuerystring()
        {
            string urlWithQueryString = "http://graph.facebook.com/me/likes?limit=3&offset=2";
            var    parameters         = new Dictionary <string, object>();

            FacebookUtils.ParseQueryParametersToDictionary(urlWithQueryString, parameters);

            Assert.Equal(2, parameters.Count);
        }
        public void ReturnPathDoesNotStartWithForwardSlash()
        {
            string originalPathWithQueryString = "/me/likes?limit=3&offset=2";
            var    parameters = new Dictionary <string, object>();

            var path = FacebookUtils.ParseQueryParametersToDictionary(originalPathWithQueryString, parameters);

            Assert.NotEqual('/', path[0]);
        }
예제 #4
0
        public void CountOfParametersEquals2()
        {
            string path       = "/me/likes?limit=3&offset=2";
            var    parameters = new Dictionary <string, object>();

            FacebookUtils.ParseQueryParametersToDictionary(path, parameters);

            Assert.Equal(2, parameters.Count);
        }
예제 #5
0
        public void ReturnPathEqualsThePathWithoutQuerystring()
        {
            string originalPath = "/me/likes?limit=3&offset=2";
            var    parameters   = new Dictionary <string, object>();

            var path = FacebookUtils.ParseQueryParametersToDictionary(originalPath, parameters);

            Assert.Equal(path, "me/likes");
        }
예제 #6
0
        public void CountOfParameterIs0()
        {
            string url        = "http://graph.facebook.com/me/likes";
            var    parameters = new Dictionary <string, object>();

            FacebookUtils.ParseQueryParametersToDictionary(url, parameters);

            Assert.Equal(0, parameters.Count);
        }
예제 #7
0
        public void ReturnPathDoesNotStartWithForwardSlash()
        {
            string url        = "http://graph.facebook.com/me/likes";
            var    parameters = new Dictionary <string, object>();

            var path = FacebookUtils.ParseQueryParametersToDictionary(url, parameters);

            Assert.NotEqual('/', path[0]);
        }
예제 #8
0
        public void TheParameterValuesAreEqualToTheQuerystrings()
        {
            string urlWithQueryString = "http://graph.facebook.com/me/likes?limit=3&offset=2";
            var    parameters         = new Dictionary <string, object>();

            FacebookUtils.ParseQueryParametersToDictionary(urlWithQueryString, parameters);

            Assert.Equal("3", parameters["limit"]);
            Assert.Equal("2", parameters["offset"]);
        }
예제 #9
0
        public void TheReturnPathEqualsPathWithoutUriHostAndDoesNotStartWithForwardSlash()
        {
            string urlWithQueryString = "http://graph.facebook.com/me/likes?limit=3&offset=2";
            string originalPathWithoutForwardSlashAndWithoutQueryString = "me/likes";
            var    parameters = new Dictionary <string, object>();

            var path = FacebookUtils.ParseQueryParametersToDictionary(urlWithQueryString, parameters);

            Assert.Equal(originalPathWithoutForwardSlashAndWithoutQueryString, path);
        }
예제 #10
0
        public void ParameterValuesEqualToTheQuerystrings()
        {
            string path       = "/me/likes?limit=3&offset=2";
            var    parameters = new Dictionary <string, object>();

            FacebookUtils.ParseQueryParametersToDictionary(path, parameters);

            Assert.Equal("3", parameters["limit"]);
            Assert.Equal("2", parameters["offset"]);
        }
예제 #11
0
        public void ReturnPathEqualsPathWithoutUriHostAndDoesntStartWithForwardSlash()
        {
            string url = "http://graph.facebook.com/me/likes";
            string originalPathWithoutForwardSlash = "me/likes";
            var    parameters = new Dictionary <string, object>();

            var path = FacebookUtils.ParseQueryParametersToDictionary(url, parameters);

            Assert.Equal(originalPathWithoutForwardSlash, path);
        }
        public void ReturnPathEqualsThePathWithoutForwardSlash()
        {
            string originalPath            = "/me/likes";
            string pathWithoutForwardSlash = "me/likes";
            var    parameters = new Dictionary <string, object>();

            var path = FacebookUtils.ParseQueryParametersToDictionary(originalPath, parameters);

            Assert.Equal(pathWithoutForwardSlash, path);
        }