Exemplo n.º 1
0
        public void ApplyParamsToUrlTestTwoSame()
        {
            Requester cm  = new Requester();
            string    url = "https://reqbin.com/echo/get/json";
            Dictionary <string, string> parameters = new Dictionary <string, string>()
            {
                { "p1", "P1" }
            };
            var newUrl = cm.ApplyParamsToUrl(url, parameters);

            parameters["p1"] = "P2";
            newUrl           = cm.ApplyParamsToUrl(newUrl, parameters);
            Assert.AreEqual("https://reqbin.com:443/echo/get/json?p1=P2", newUrl);
        }
Exemplo n.º 2
0
        public void ApplyParamsToUrlTestEmpty()
        {
            Requester cm  = new Requester();
            string    url = "https://reqbin.com/echo/get/json";
            Dictionary <string, string> parameters = new Dictionary <string, string>();
            var newUrl = cm.ApplyParamsToUrl(url, parameters);

            Assert.AreEqual("https://reqbin.com:443/echo/get/json", newUrl);
        }
Exemplo n.º 3
0
        public void ApplyParamsToUrlTestForcedPort2()
        {
            Requester cm  = new Requester();
            string    url = "https://reqbin.com:50080/echo/get/json";
            Dictionary <string, string> parameters = new Dictionary <string, string>()
            {
                { "p1", "P1" }
            };
            var newUrl = cm.ApplyParamsToUrl(url, parameters);

            Assert.AreEqual("https://reqbin.com:50080/echo/get/json?p1=P1", newUrl);
        }