Exemple #1
0
        public void TestGetProxyStringWithUsernamePasswordWithReservedCharacters()
        {
            IWebProxy proxy = new WebProxy("127.0.0.1")
            {
                Credentials = new NetworkCredential("user:name", "pass:word")
            };

            Assert.AreEqual("http://user%3Aname:pass%[email protected]:80", proxy.GetProxyString());
        }
Exemple #2
0
        public void TestGetProxyStringWithHttpAddress()
        {
            IWebProxy proxy = new WebProxy("127.0.0.1");

            Assert.AreEqual("http://127.0.0.1:80", proxy.GetProxyString());
        }
Exemple #3
0
        public void TestGetProxyStringWithEmptyProxy()
        {
            IWebProxy proxy = new WebProxy();

            Assert.AreEqual(string.Empty, proxy.GetProxyString());
        }
Exemple #4
0
        public void TestGetProxyStringWithSocks5AddressWithProtocol()
        {
            IWebProxy proxy = new WebProxy("socks5://127.0.0.1");

            Assert.AreEqual("socks5://127.0.0.1:1080", proxy.GetProxyString());
        }