本文整理汇总了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);
}
示例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);
}
示例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));
}