Esempio n. 1
0
        //In this test we check if the proxy setting set last persists.
        //In this test case it is the ProxyPort and ProxyHost.
        //[Test]
        //[Category("S3PCLProxy")]
        public void HostPortPrecedenceSetting()
        {
            var customProxy = new WebProxy("http://localhost:8889/");
            var config      = new AmazonS3Config();

            config.SetWebProxy(customProxy);
            config.ProxyHost        = "127.0.0.1";
            config.ProxyPort        = 8888;
            config.ProxyCredentials = new NetworkCredential("1", "1");
            config.RegionEndpoint   = RegionEndpoint.USEast1;

            var setProxy = new WebProxy(config.ProxyHost, config.ProxyPort);

            config.SetWebProxy(setProxy);
            var c = config.GetWebProxy();

            Assert.AreEqual(setProxy, config.GetWebProxy());
        }
Esempio n. 2
0
        //In this test a S3ListBucket operation is executed over a Proxy URL
        //[Test]
        //[Category("S3PCLProxy")]
        public void CreateClientUsingProxy()
        {
            var config = new AmazonS3Config
            {
                ProxyCredentials = new NetworkCredential("1", "1"),
                RegionEndpoint   = RegionEndpoint.USEast1
            };

            config.SetWebProxy(new WebProxy("http://localhost:8888/"));
            client = new AmazonS3Client("access key", "access Password", config);
            ListBuckets();
        }
Esempio n. 3
0
        //In this test we check if the proxy setting set last persists.
        //In this test case it is the Proxy URL
        //[Test]
        //[Category("S3PCLProxy")]
        public void WebProxyPrecedenceSetting()
        {
            var config = new AmazonS3Config
            {
                ProxyHost        = "127.0.0.1",
                ProxyPort        = 0,
                ProxyCredentials = new NetworkCredential("1", "1"),
                RegionEndpoint   = RegionEndpoint.USEast1,
                UseHttp          = true
            };
            var customProxy = new WebProxy("http://localhost:8888/");

            config.SetWebProxy(customProxy);
            Assert.AreEqual(customProxy, config.GetWebProxy());
        }