Пример #1
0
        public void HandlesArraysInQueryMap()
        {
            var requestInfo = new RequestInfo(HttpMethod.Get, null);

            requestInfo.AddQueryCollectionMap <string, string[], string>(QuerySerializationMethod.ToString, new Dictionary <string, string[]>()
            {
                { "foo", new[] { "bar", "baz" } },
            });
            var uri = this.requester.ConstructUri(null, "/foo", requestInfo);

            Assert.Equal(new Uri("http://api.example.com/base/foo?foo=bar&foo=baz"), uri);
        }
Пример #2
0
 public void HandlesArraysInQueryMap()
 {
     var requestInfo = new RequestInfo(HttpMethod.Get, null);
     requestInfo.AddQueryCollectionMap<string, string[], string>(QuerySerializationMethod.ToString, new Dictionary<string, string[]>()
     {
         { "foo", new[] { "bar", "baz" } },
     });
     var uri = this.requester.ConstructUri("/foo", requestInfo);
     Assert.Equal(new Uri("http://api.example.com/base/foo?foo=bar&foo=baz"), uri);
 }