Exemple #1
0
        public void GivenAProxyConfigVerifyIsSetCorrect()
        {
            var      apiHandler = new ApiProxyFactory(mockConfiguration.Object);
            WebProxy result     = (WebProxy)apiHandler.GetWebProxy();

            Assert.NotNull(result);
            Assert.Equal(result.BypassProxyOnLocal, bypassOnLocal);
            Assert.Equal(result.Address.Host, host);
            Assert.Equal(result.Address.Port, port);
            Assert.Equal(result.UseDefaultCredentials, useDefaultCredential);
        }
Exemple #2
0
        public void GivenAProxyConfigIgnoreVerifyIsSetCorrect()
        {
            var useNoProxySection = new Mock <IConfigurationSection>();

            useNoProxySection.Setup(a => a.Value).Returns("false");
            mockConfiguration.Setup(a => a.GetSection("ChartApi:Proxy:UseProxy")).Returns(useNoProxySection.Object);

            var      apiHandler = new ApiProxyFactory(mockConfiguration.Object);
            WebProxy result     = (WebProxy)apiHandler.GetWebProxy();

            Assert.Null(result);
        }