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); }
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); }