From 3e5e3d9cd35ef05cd72b5c9dd9915af010a86e08 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 22 Sep 2025 16:51:29 +0300 Subject: [PATCH] Switch HttpProxySettingsProviderFixture to test cases (cherry picked from commit 4e8fe6e81b1ac3f53135ad2e2b95d7aae811b87e) --- .../Http/HttpProxySettingsProviderFixture.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs b/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs index 2beeb16f9..327b33e48 100644 --- a/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs +++ b/src/NzbDrone.Core.Test/Http/HttpProxySettingsProviderFixture.cs @@ -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); } - [Test] - public void should_bypass_proxy() + [TestCase("http://eu.httpbin.org/get")] + [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(); - Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://eu.httpbin.org/get")).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(); + Subject.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeTrue(); } - [Test] - public void should_not_bypass_proxy() + [TestCase("http://bing.com/get")] + [TestCase("http://172.3.0.1:8989/api/v3/indexer/schema")] + public void should_not_bypass_proxy(string url) { var settings = GetProxySettings(); - Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://bing.com/get")).Should().BeFalse(); - Subject.ShouldProxyBeBypassed(settings, new HttpUri("http://172.3.0.1:8989/api/v3/indexer/schema")).Should().BeFalse(); + Subject.ShouldProxyBeBypassed(settings, new HttpUri(url)).Should().BeFalse(); } } }