static void AssertSystemProxySettings(IProxySettings proxySettings, bool hasCredentials) { var proxy = proxySettings.Should().BeOfType <UseSystemProxySettings>() .Subject; if (hasCredentials) { proxy.Username.Should().Be(ProxyUserName); proxy.Password.Should().Be(ProxyPassword); } else { proxy.Username.Should().BeNull(); proxy.Password.Should().BeNull(); } }
void AssertCustomProxy(IProxySettings proxySettings, bool hasCredentials) { var proxy = proxySettings.Should().BeOfType <UseCustomProxySettings>() .Subject; proxy.Host.Should().Be(proxyHost); proxy.Port.Should().Be(proxyPort); if (hasCredentials) { proxy.Username.Should().Be(ProxyUserName); proxy.Password.Should().Be(ProxyPassword); } else { proxy.Username.Should().BeNull(); proxy.Password.Should().BeNull(); } }
void AssertBypassProxy(IProxySettings proxySettings) { proxySettings.Should().BeOfType <BypassProxySettings>(); }