当前位置: 首页>>代码示例>>C#>>正文


C# AmazonEC2Config.GetWebProxy方法代码示例

本文整理汇总了C#中Amazon.EC2.AmazonEC2Config.GetWebProxy方法的典型用法代码示例。如果您正苦于以下问题:C# AmazonEC2Config.GetWebProxy方法的具体用法?C# AmazonEC2Config.GetWebProxy怎么用?C# AmazonEC2Config.GetWebProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Amazon.EC2.AmazonEC2Config的用法示例。


在下文中一共展示了AmazonEC2Config.GetWebProxy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestProxySetupHostAndPortOnly

        public void TestProxySetupHostAndPortOnly()
        {
            var dummyConfig = new AmazonEC2Config();

            dummyConfig.ProxyHost = Host;
            dummyConfig.ProxyPort = Port;

            WebProxy proxy = dummyConfig.GetWebProxy();
            var address = proxy.Address;
            Assert.AreEqual(address.Host, Host);
            Assert.AreEqual(address.Port, Port);
            Assert.AreEqual(0, proxy.BypassList.Length);
            Assert.IsFalse(proxy.BypassProxyOnLocal);
        }
开发者ID:aws,项目名称:aws-sdk-net,代码行数:14,代码来源:ProxyTests.cs

示例2: TestProxySetupWithBypass

        public void TestProxySetupWithBypass()
        {
            var dummyConfig = new AmazonEC2Config();

            dummyConfig.ProxyHost = Host;
            dummyConfig.ProxyPort = Port;

            dummyConfig.ProxyBypassList = new List<string>(BypassList);
            dummyConfig.ProxyBypassOnLocal = true;

            WebProxy proxy = dummyConfig.GetWebProxy();
            Assert.AreEqual(BypassList.Count, proxy.BypassList.Length);
            // making assumption here that order is retained on assignment 
            // inside WebProxy - seems to be the case
            for (int i = 0; i < BypassList.Count; i++)
            {
                Assert.AreEqual(BypassList[i], proxy.BypassList[i]);
            }

            Assert.IsTrue(proxy.BypassProxyOnLocal);
        }
开发者ID:aws,项目名称:aws-sdk-net,代码行数:21,代码来源:ProxyTests.cs

示例3: TestProxySetupWithSchemedHost

        public void TestProxySetupWithSchemedHost()
        {
            // verifies bug fix that the http:// scheme is not doubled 
            // up in the proxy address if the user specifies it when setting
            // proxy host (the bug yielded an address like http://http/host)

            var dummyConfig = new AmazonEC2Config();

            var host = string.Concat("http://", Host);
            dummyConfig.ProxyHost = host;
            dummyConfig.ProxyPort = Port;

            WebProxy proxy = dummyConfig.GetWebProxy();
            Assert.IsTrue(proxy.Address.ToString().StartsWith(host, StringComparison.OrdinalIgnoreCase));
        }
开发者ID:aws,项目名称:aws-sdk-net,代码行数:15,代码来源:ProxyTests.cs


注:本文中的Amazon.EC2.AmazonEC2Config.GetWebProxy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。