Beispiel #1
0
        public void complex_URL_withPOST_singleParameters_UNICODE()
        {
            //Arrange
            string test_Url = "https://myserver.com/alles/easy";
            string expected_Url = "https://myserver.com/alles/easy";
            string test_POSTstream = "data=Straße&data1=Einöde&data2=§";

            Dictionary<string, string> expected_parameters = new Dictionary<string, string>();
            expected_parameters.Add("data", "Straße"); expected_parameters.Add("data1", "Einöde"); expected_parameters.Add("data2", "§");
            //Act
            HttpUrl URL_Handler = new HttpUrl();
            URL_Handler.CWebURL(test_Url);
            URL_Handler.PostParameters(test_POSTstream);

            string actual_Address = URL_Handler.WebAddress;
            Dictionary<string, string> actual_parameters = URL_Handler.WebParameters;
            //Assert
            Assert.AreEqual(actual_Address, expected_Url, "Address was not parsed correctly");
            CollectionAssert.AreEquivalent(actual_parameters, expected_parameters, "The parameters were not parsed correctly");
        }
Beispiel #2
0
        public void Complex_URL_withPOST_singleParameters()
        {
            //Arrange
            string test_Url = "https://myserver.com/Home/lol";
            string expected_Url = "https://myserver.com/Home/lol";
            string test_POSTstream = "data=test1";

            Dictionary<string, string> expected_parameters = new Dictionary<string, string>();
            expected_parameters.Add("data", "test1");
            //Act
            HttpUrl URL_Handler = new HttpUrl();
            URL_Handler.CWebURL(test_Url);
            URL_Handler.PostParameters(test_POSTstream);

            string actual_Address = URL_Handler.WebAddress;
            Dictionary<string, string> actual_parameters = URL_Handler.WebParameters;
            //Assert
            Assert.AreEqual(actual_Address, expected_Url, "Address was not parsed correctly");
            CollectionAssert.AreEquivalent(actual_parameters, expected_parameters, "The parameters were not parsed correctly");
        }