mirror of
https://github.com/Sonarr/Sonarr
synced 2025-12-06 08:28:37 +01:00
Switch HttpProxySettingsProviderFixture to test cases
This commit is contained in:
parent
8bab0a06dd
commit
b1f77007dc
1 changed files with 10 additions and 10 deletions
|
|
@ -15,24 +15,24 @@ private HttpProxySettings GetProxySettings()
|
||||||
return new HttpProxySettings(ProxyType.Socks5, "localhost", 8080, "*.httpbin.org,google.com,172.16.0.0/12", true, null, null);
|
return new HttpProxySettings(ProxyType.Socks5, "localhost", 8080, "*.httpbin.org,google.com,172.16.0.0/12", true, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase("http://eu.httpbin.org/get")]
|
||||||
public void should_bypass_proxy()
|
[TestCase("http://google.com/get")]
|
||||||
|
[TestCase("http://localhost:8654/get")]
|
||||||
|
[TestCase("http://172.21.0.1:8989/api/v3/indexer/schema")]
|
||||||
|
public void should_bypass_proxy(string url)
|
||||||
{
|
{
|
||||||
var settings = GetProxySettings();
|
var settings = GetProxySettings();
|
||||||
|
|
||||||
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://eu.httpbin.org/get")).Should().BeTrue();
|
Subject.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeTrue();
|
||||||
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://google.com/get")).Should().BeTrue();
|
|
||||||
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://localhost:8654/get")).Should().BeTrue();
|
|
||||||
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://172.21.0.1:8989/api/v3/indexer/schema")).Should().BeTrue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase("http://bing.com/get")]
|
||||||
public void should_not_bypass_proxy()
|
[TestCase("http://172.3.0.1:8989/api/v3/indexer/schema")]
|
||||||
|
public void should_not_bypass_proxy(string url)
|
||||||
{
|
{
|
||||||
var settings = GetProxySettings();
|
var settings = GetProxySettings();
|
||||||
|
|
||||||
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://bing.com/get")).Should().BeFalse();
|
Subject.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeFalse();
|
||||||
Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://172.3.0.1:8989/api/v3/indexer/schema")).Should().BeFalse();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue