Esempio n. 1
0
        public void ExtendUrlEscape()
        {
            var url = UrlUtils.CreateUrl("http://test.com", new Dictionary <string, string>()
            {
                ["key1"] = "value1 value2",
            });

            Assert.Equal("http://test.com/?key1=value1%20value2", url);

            url = UrlUtils.ExtendUrl(url, new Dictionary <string, string> {
                ["key2"] = "value2"
            });

            Assert.Equal("http://test.com/?key1=value1%20value2&key2=value2", url);

            url = UrlUtils.ExtendUrl(url, new Dictionary <string, string> {
                ["key1"] = "value1",
                ["key3"] = "value3",
            });

            Assert.Equal("http://test.com/?key1=value1&key2=value2&key3=value3", url);
        }