public void TestWhenNoPreviousProxy()
        {
            var sps = new SystemProxySettings(false, null, null);

            sps.SetHttpSpecificProxy(host1, port1);
            Assert.IsFalse(sps.ProxyEnable);
            sps.ProxyEnable = true;
            Assert.AreEqual(proxy1b, sps.ProxyServer);
            Assert.AreEqual(null, sps.ProxyOverride);

            string host;
            int    port;

            sps.GetHttpSpecificProxy(out host, out port);
            Assert.AreEqual(host1, host);
            Assert.AreEqual(port1, port);

            sps = new SystemProxySettings(false, proxy1a, "blah");
            sps.SetHttpSpecificProxy(host2, port2);
            Assert.IsFalse(sps.ProxyEnable);
            sps.ProxyEnable = true;
            Assert.AreEqual(proxy2c, sps.ProxyServer);
            Assert.AreEqual("blah", sps.ProxyOverride);

            sps.GetHttpSpecificProxy(out host, out port);
            Assert.AreEqual(host2, host);
            Assert.AreEqual(port2, port);
        }
 public void TestProxySetButNoHost()
 {
     var sps = new SystemProxySettings(true, null, null);
     string host;
     int port;
     sps.GetHttpSpecificProxy(out host, out port);
     Assert.IsNull(host);
 }
        public void TestProxySetButNoHost()
        {
            var    sps = new SystemProxySettings(true, null, null);
            string host;
            int    port;

            sps.GetHttpSpecificProxy(out host, out port);
            Assert.IsNull(host);
        }
        public void TestWhenPreviousAllProtocolProxy()
        {
            var sps = new SystemProxySettings(true, proxy2a, null);

            sps.SetHttpSpecificProxy(host1, port1);
            Assert.AreEqual(proxy2d, sps.ProxyServer);
            Assert.AreEqual(null, sps.ProxyOverride);

            string host;
            int    port;

            sps.GetHttpSpecificProxy(out host, out port);
            Assert.AreEqual(host1, host);
            Assert.AreEqual(port1, port);
        }
        public void TestWhenPreviousFtpOnlyProxy()
        {
            var sps = new SystemProxySettings(true, proxy3b, null);

            sps.SetHttpSpecificProxy(host2, port2);
            Assert.AreEqual(proxy3c, sps.ProxyServer);
            Assert.AreEqual(null, sps.ProxyOverride);

            string host;
            int    port;

            sps.GetHttpSpecificProxy(out host, out port);
            Assert.AreEqual(host2, host);
            Assert.AreEqual(port2, port);
        }
        public void TestWhenNoPreviousProxy()
        {
            var sps = new SystemProxySettings(false, null, null);
            sps.SetHttpSpecificProxy(host1, port1);
            Assert.IsFalse(sps.ProxyEnable);
            sps.ProxyEnable = true;
            Assert.AreEqual(proxy1b, sps.ProxyServer);
            Assert.AreEqual(null, sps.ProxyOverride);

            string host;
            int port;
            sps.GetHttpSpecificProxy(out host, out port);
            Assert.AreEqual(host1, host);
            Assert.AreEqual(port1, port);

            sps = new SystemProxySettings(false, proxy1a, "blah");
            sps.SetHttpSpecificProxy(host2, port2);
            Assert.IsFalse(sps.ProxyEnable);
            sps.ProxyEnable = true;
            Assert.AreEqual(proxy2c, sps.ProxyServer);
            Assert.AreEqual("blah", sps.ProxyOverride);

            sps.GetHttpSpecificProxy(out host, out port);
            Assert.AreEqual(host2, host);
            Assert.AreEqual(port2, port);
        }
        public void TestWhenPreviousHtmlOnlyProxy()
        {
            var sps = new SystemProxySettings(true, proxy2b, null);
            sps.SetHttpSpecificProxy(host1, port1);
            Assert.AreEqual(proxy1b, sps.ProxyServer);
            Assert.AreEqual(null, sps.ProxyOverride);

            string host;
            int port;
            sps.GetHttpSpecificProxy(out host, out port);
            Assert.AreEqual(host1, host);
            Assert.AreEqual(port1, port);
        }