Exemple #1
0
        public void DictToQuerystring_null_value()
        {
            var s = UrlHelperExtensions.DictToQuerystring(new Dictionary <string, string> {
                { "pp", null },
            });

            Assert.AreEqual("pp=", s);
        }
Exemple #2
0
        public void DictToQuerystring_empty_key()
        {
            var s = UrlHelperExtensions.DictToQuerystring(new Dictionary <string, string> {
                { "", "a" },
            });

            Assert.AreEqual("", s);
        }
Exemple #3
0
        public void DictToQuerystring_url_encodes()
        {
            var s = UrlHelperExtensions.DictToQuerystring(new Dictionary <string, string> {
                { "pp", "==" },
            });

            Assert.AreEqual("pp=%3d%3d", s);
        }
Exemple #4
0
        public void DictToQuerystring_many_params()
        {
            var s = UrlHelperExtensions.DictToQuerystring(new Dictionary <string, string> {
                { "pp", "1" },
                { "two", "two2" },
            });

            Assert.AreEqual("pp=1&two=two2", s);
        }
Exemple #5
0
        public void DictToQuerystring_empty()
        {
            var s = UrlHelperExtensions.DictToQuerystring(new Dictionary <string, string>());

            Assert.Equal("", s);
        }