Exemple #1
0
        public void AddsTwoRawQueryStringsOnTheirOwn()
        {
            var requestInfo = new RequestInfo(HttpMethod.Get, null);

            requestInfo.AddRawQueryParameter("foo=bar&baz=woo");
            requestInfo.AddRawQueryParameter("bar=foo&woo=baz");
            var uri = this.requester.ConstructUri(null, "a", requestInfo);

            Assert.Equal("http://api.example.com/base/a?foo=bar&baz=woo&bar=foo&woo=baz", uri.ToString(), ignoreCase: true);
        }
Exemple #2
0
        public void AddsRawQueryStringToPreexistingQueryString()
        {
            var requestInfo = new RequestInfo(HttpMethod.Get, null);

            requestInfo.AddRawQueryParameter("foo=bar&baz=woo");
            var uri = this.requester.ConstructUri(null, "a?b=c", requestInfo);

            Assert.Equal("http://api.example.com/base/a?b=c&foo=bar&baz=woo", uri.ToString(), ignoreCase: true);
        }
Exemple #3
0
        public void PrependsRawQueryStringWithQueryParams()
        {
            var requestInfo = new RequestInfo(HttpMethod.Get, null);

            requestInfo.AddRawQueryParameter("foo=bar&baz=woo");
            requestInfo.AddQueryParameter(QuerySerializationMethod.ToString, "a", "&b");
            var uri = this.requester.ConstructUri(null, "a", requestInfo);

            Assert.Equal("http://api.example.com/base/a?foo=bar&baz=woo&a=%26b", uri.ToString(), ignoreCase: true);
        }