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

            requestInfo.AddQueryProperty(QuerySerializationMethod.ToString, "foo", "bar");
            var uri = this.requester.ConstructUri(null, "foo", requestInfo);

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

            requestInfo.AddQueryProperty <string>(QuerySerializationMethod.ToString, "foo", null);
            requestInfo.AddQueryParameter(QuerySerializationMethod.ToString, "foo", "baz");
            var uri = this.requester.ConstructUri(null, "foo", requestInfo);

            Assert.Equal("http://api.example.com/base/foo?foo=baz", uri.ToString(), ignoreCase: true);
        }